1

I am developing an application where I need to extract text and barcode values from image. For this I am using Firebase ML Kit.

I have added below dependencies in build.gradle

   // ML Kit dependencies
    implementation 'com.google.firebase:firebase-ml-vision:24.0.3'
    // Barcode detection model.
    implementation 'com.google.firebase:firebase-ml-vision-barcode-model:16.1.1'

AndroidManifest.xml

 <meta-data
        android:name="com.google.firebase.ml.vision.DEPENDENCIES"
        android:value="ocr,barcode" />

Now the problem is when I use both firebase-ml-vision:24.0.3 and firebase-ml-vision-barcode-model:16.1.1 then I am getting less number of barcode result after scanning image but If I use only firebase-ml-vision:24.0.3 then I am getting more number of barcode result.

Is there any issue or am I doing wrong while implementations?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Deepak Sachdeva
  • 950
  • 8
  • 16

1 Answers1

2

There is a change of underlying model but I would expect improved, not deteriorated results in your setup.

In any case, can you please try the new standalone ML Kit and see things improve? We fixed the PDF417 detection as well as improved on recall.

You can use the new modules by with these build.gradle settings:

implementation 'com.google.android.gms:play-services-mlkit-barcode-scanning:16.1.0'
implementation 'com.google.android.gms:play-services-mlkit-text-recognition:16.1.0'

and

<meta-data
        android:name="com.google.mlkit.vision.DEPENDENCIES"
        android:value="ocr,barcode" />

Here are further instructions for the barcode and text recognition APIs. There are slight changes to the API but they should be fairly intuitive. One thing to note is that getting more result is not always better, they can be false positives and could be a sign of high recall which is something we have improved on in the latest model.

If you still have problem with the new API, please file an issue with example images so we can take a look. Thanks!

Hoi
  • 599
  • 2
  • 7