Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit 17fe686

Browse files
Add support for ML Kit Object Detection and Tracking #1274
1 parent 18b563c commit 17fe686

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

demo-ng/app/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"android": {
3-
"v8Flags": "--expose_gc"
3+
"v8Flags": "--expose_gc",
4+
"markingMode": "none"
45
},
5-
"discardUncaughtJsExceptions": true,
6+
"discardUncaughtJsExceptions": false,
67
"main": "main.js",
78
"name": "tns-template-hello-world-ng",
89
"version": "3.3.0"

src/mlkit/mlkit-cameraview.android.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,6 @@ export abstract class MLKitCameraView extends MLKitCameraViewBase {
264264
}
265265
}
266266

267-
console.log(">> scaled fixed to: " + scaleX + " x " + scaleY);
268267
this.surfaceView.setScaleX(scaleX);
269268
this.surfaceView.setScaleY(scaleY);
270269
}

src/mlkit/objectdetection/index.android.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,9 @@ export function detectObjects(options: MLKitObjectDetectionOptions): Promise<MLK
9191
}
9292

9393
function getMLKitObjectDetectionResultItem(obj: com.google.firebase.ml.vision.objects.FirebaseVisionObject): MLKitObjectDetectionResultItem {
94-
console.log("getMLKitObjectDetectionResultItem");
95-
console.log("obj: " + obj);
9694
return {
97-
id: obj.getTrackingId().intValue(),
98-
confidence: obj.getClassificationConfidence().doubleValue(),
95+
id: obj.getTrackingId() ? obj.getTrackingId().intValue() : undefined,
96+
confidence: obj.getClassificationConfidence() ? obj.getClassificationConfidence().doubleValue() : undefined,
9997
category: ObjectDetectionCategory[obj.getClassificationCategory()],
10098
// TODO
10199
image: undefined,

src/mlkit/objectdetection/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export interface MLKitObjectDetectionResultItem {
1818
*/
1919
id?: number;
2020
confidence: number;
21-
category: any; // TODO
21+
category: any;
2222
bounds: MLKitObjectDetectionResultItemBounds;
2323
image: {
2424
width: number;

0 commit comments

Comments
 (0)