-1

Not for Label Detection for all the Cloud Vision API (Text Recognition, Label Detection, Facial Recognition), only the addOnFailure method is calling while using cloud instances;

But while using Device Instance it works fine

The Below is the code for Label Detection using Cloud Instance:

final FirebaseVisionImage image = FirebaseVisionImage.fromBitmap(myBitmap);

FirebaseVisionImageLabeler labeler = FirebaseVision.getInstance()
                                    .getCloudImageLabeler();

labeler.processImage(image)

.addOnSuccessListener(new OnSuccessListener<List<FirebaseVisionImageLabel>>() {

@Override
public void onSuccess(List<FirebaseVisionImageLabel> labels) {

Toast.makeText(ResultActivity.this, "success", Toast.LENGTH_SHORT).show();

getResults(labels);

}
})

.addOnFailureListener(new OnFailureListener() {

@Override
public void onFailure(@NonNull Exception e) {
Toast.makeText(ResultActivity.this, "failure", Toast.LENGTH_SHORT).show();
}
});
Marcin Orlowski
  • 72,056
  • 11
  • 123
  • 141

1 Answers1

0

I have found that By setting up Google Cloud Console Payment for Cloud Vision API, the Success method is calling