@@ -8,13 +8,13 @@ declare const com: any;
88export class MLKitObjectDetection extends MLKitObjectDetectionBase {
99
1010 protected createDetector ( ) : any {
11- return getDetector ( true , this . classify , this . multiple ) ;
11+ return getDetector ( this . classify , this . multiple ) ;
1212 }
1313
1414 protected createSuccessListener ( ) : any {
1515 return new com . google . android . gms . tasks . OnSuccessListener ( {
1616 onSuccess : objects => {
17- console . log ( ">> onSuccess @ " + new Date ( ) . getTime ( ) + ", objects: " + objects ) ;
17+ console . log ( ">> onSuccess @ " + new Date ( ) . getTime ( ) + ", objects: " + objects . size ( ) ) ;
1818
1919 if ( objects . size ( ) === 0 ) return ;
2020
@@ -37,9 +37,9 @@ export class MLKitObjectDetection extends MLKitObjectDetectionBase {
3737 }
3838}
3939
40- function getDetector ( stream : boolean , classify : boolean , multiple : boolean ) : com . google . firebase . ml . vision . objects . FirebaseVisionObjectDetector {
40+ function getDetector ( classify : boolean , multiple : boolean ) : com . google . firebase . ml . vision . objects . FirebaseVisionObjectDetector {
4141 const builder = new com . google . firebase . ml . vision . objects . FirebaseVisionObjectDetectorOptions . Builder ( )
42- . setDetectorMode ( stream ? com . google . firebase . ml . vision . objects . FirebaseVisionObjectDetectorOptions . STREAM_MODE : com . google . firebase . ml . vision . objects . FirebaseVisionObjectDetectorOptions . SINGLE_IMAGE_MODE ) ;
42+ . setDetectorMode ( com . google . firebase . ml . vision . objects . FirebaseVisionObjectDetectorOptions . SINGLE_IMAGE_MODE ) ;
4343
4444 if ( classify ) {
4545 builder . enableClassification ( ) ;
@@ -55,7 +55,7 @@ function getDetector(stream: boolean, classify: boolean, multiple: boolean): com
5555export function detectObjects ( options : MLKitObjectDetectionOptions ) : Promise < MLKitObjectDetectionResult > {
5656 return new Promise ( ( resolve , reject ) => {
5757 try {
58- const firebaseObjectDetector = getDetector ( false , options . classify , options . multiple ) ;
58+ const firebaseObjectDetector = getDetector ( options . classify , options . multiple ) ;
5959
6060 const onSuccessListener = new com . google . android . gms . tasks . OnSuccessListener ( {
6161 onSuccess : objects => {
0 commit comments