FirebaseVisionObjectDetector

public class FirebaseVisionObjectDetector extends Object
implements Closeable Closeable

This class is deprecated.
The standalone ML Kit SDK replaces this API. For more information, refer to the migration guide.

Detector for finding FirebaseVisionObjects in a supplied image.

A object detector is created via getOnDeviceObjectDetector(FirebaseVisionObjectDetectorOptions) or getOnDeviceObjectDetector(), if you wish to use the default options. For example, the code below creates an object detector with default options.

 FirebaseVisionObjectDetector objectDetector =
    FirebaseVision.getInstance().getOnDeviceObjectDetector();
 
To perform object detection in an image, you first need to create an instance of FirebaseVisionImage from a Bitmap, ByteBuffer, etc. See FirebaseVisionImage documentation for more details. For example, the code below creates a FirebaseVisionImage from a ByteBuffer.
 FirebaseVisionImage image
    = FirebaseVisionImage.fromByteBuffer(byteBuffer, imageMetadata);
 
Then the code below can detect objects in the supplied FirebaseVisionImage.

 Task<List<FirebaseVisionObject>> task = objectDetector.processImage(image);
 task.addOnSuccessListener(...).addOnFailureListener(...);
 

Public Method Summary

void
Task<List<FirebaseVisionObject>>
processImage(FirebaseVisionImage image)
Detects objects from supplied image.

Inherited Method Summary

Object
clone()
boolean
equals(Object arg0)
void
finalize()
final Class<?>
getClass()
int
hashCode()
final void
notify()
final void
notifyAll()
String
toString()
final void
wait(long arg0, int arg1)
final void
wait(long arg0)
final void
wait()
abstract void
close()
abstract void
close()

Public Methods

public void close ()

Throws

public Task<List<FirebaseVisionObject>> processImage (FirebaseVisionImage image)

Detects objects from supplied image.

For best efficiency, create a FirebaseVisionImage object using following way:

All other FirebaseVisionImage factory methods will work as well, but possibly slightly slower.

Note that the width and height of the provided image cannot be less than 32.

Returns

Firebase gives you the tools and infrastructure you need to build better mobile and web apps, improve app quality, and grow your business.

Updated Aug 14, 2020