Detector for finding
FirebaseVisionCloudLabels in a supplied image.
A cloud label detector is created via
getVisionCloudLabelDetector(FirebaseVisionCloudDetectorOptions), or
getVisionCloudLabelDetector() if you wish to use the default options. For example,
the code below creates a label detector with default options.
FirebaseVisionCloudLabelDetector cloudLabelDetector =
FirebaseVision.getInstance().getVisionCloudLabelDetector();FirebaseVisionImage
from a Bitmap,
ByteBuffer,
etc. See FirebaseVisionImage
documentation for more details. For example, the code below creates a FirebaseVisionImage
from a Bitmap.
FirebaseVisionImage image = FirebaseVisionImage.fromBitmap(bitmap);FirebaseVisionImage.
Task<List<FirebaseVisionCloudLabel>> task = cloudLabelDetector.detectInImage(image);
task.addOnSuccessListener(...).addOnFailureListener(...);
Public Method Summary
| void |
close()
|
| Task<List<FirebaseVisionCloudLabel>> |
Inherited Method Summary
Public Methods
public void close ()
Throws
| IOException |
|---|
public Task<List<FirebaseVisionCloudLabel>> detectInImage (FirebaseVisionImage image)
Detects labels from supplied image.
For best efficiency, create a
FirebaseVisionImage object using one of the following ways:
fromMediaImage(Image, int)with aJPEGformatted image fromandroid.hardware.camera2.fromBitmap(android.graphics.Bitmap).
FirebaseVisionImage factory methods will work as well, but possibly slightly
slower.
Returns
- A
Taskthat asynchronously returns aListof detectedFirebaseVisionCloudLabels. An empty list is returned by theTaskif nothing is found.