ObjectDetectorOptionsBase
Stay organized with collections
Save and categorize content based on your preferences.
Constant Summary
int |
SINGLE_IMAGE_MODE
|
It is designed for single images where the
detection of each image is independent. |
int |
STREAM_MODE
|
It is designed for streaming frames from video
or camera. |
Public Method Summary
boolean |
equals( Object o)
Indicates whether some other object is "equal to" this one.
|
int |
hashCode()
Returns a hash code value for the object.
|
Inherited Method Summary
From class java.lang.Object
Object
|
clone()
|
boolean |
|
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()
|
Constants
public static final int
SINGLE_IMAGE_MODE
It is designed for single images where the detection of each image is independent.
In this mode, the detector would return detection results slower than
STREAM_MODE
.
Constant Value: 2
public static final int
STREAM_MODE
It is designed for streaming frames from video or camera. In this mode, the detector
would return the detection results faster than
SINGLE_IMAGE_MODE
, since it leverages the detection results from previous
images. Therefore, it may not return results for a new object in the first few frames
after a new object appears in the images, since there is no previous result about this
object to help.
Note that if the time-interval between two consecutive frames is too large, say
several hundred milliseconds, the previous detected objects would be lost and all
objects would be treated as new objects.
Constant Value: 1
Public Methods
public boolean equals (Object o)
Indicates whether some other object is "equal to" this one.
public int hashCode ()
Returns a hash code value for the object.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eObjectDetectorOptionsBase\u003c/code\u003e provides base options for configuring object detection in ML Kit.\u003c/p\u003e\n"],["\u003cp\u003eIt offers two detection modes: \u003ccode\u003eSINGLE_IMAGE_MODE\u003c/code\u003e for individual images and \u003ccode\u003eSTREAM_MODE\u003c/code\u003e for continuous video or camera streams.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eSTREAM_MODE\u003c/code\u003e prioritizes speed but may initially miss new objects, while \u003ccode\u003eSINGLE_IMAGE_MODE\u003c/code\u003e is slower but more thorough for static images.\u003c/p\u003e\n"],["\u003cp\u003eConcrete implementations include \u003ccode\u003eObjectDetectorOptions\u003c/code\u003e for pre-defined models and \u003ccode\u003eCustomObjectDetectorOptions\u003c/code\u003e for custom models.\u003c/p\u003e\n"]]],[],null,["# ObjectDetectorOptionsBase\n\npublic abstract class **ObjectDetectorOptionsBase** extends [Object](//developer.android.com/reference/java/lang/Object.html) \n\n|---|---|---|\n| Known Direct Subclasses [CustomObjectDetectorOptions](/android/reference/com/google/mlkit/vision/objects/custom/CustomObjectDetectorOptions), [ObjectDetectorOptions](/android/reference/com/google/mlkit/vision/objects/defaults/ObjectDetectorOptions) |----------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------| | [CustomObjectDetectorOptions](/android/reference/com/google/mlkit/vision/objects/custom/CustomObjectDetectorOptions) | Options for [ObjectDetector](/android/reference/com/google/mlkit/vision/objects/ObjectDetector) with custom classifier models. | | [ObjectDetectorOptions](/android/reference/com/google/mlkit/vision/objects/defaults/ObjectDetectorOptions) | Options for [ObjectDetector](/android/reference/com/google/mlkit/vision/objects/ObjectDetector) with a predefined and bundled classifier model. | |||\n\nBase options for [ObjectDetector](/android/reference/com/google/mlkit/vision/objects/ObjectDetector).\n\nConcrete child classes include [ObjectDetectorOptions](/android/reference/com/google/mlkit/vision/objects/defaults/ObjectDetectorOptions)\nand [CustomObjectDetectorOptions](/android/reference/com/google/mlkit/vision/objects/custom/CustomObjectDetectorOptions). \n\n### Nested Class Summary\n\n|------------|---|---|-------------------------------------------------------------------------------------------|\n| @interface | [ObjectDetectorOptionsBase.DetectorMode](/android/reference/com/google/mlkit/vision/objects/ObjectDetectorOptionsBase.DetectorMode) || The detector mode which indicates whether detection is for single image or for streaming. |\n\n### Constant Summary\n\n|-----|---------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------|\n| int | [SINGLE_IMAGE_MODE](/android/reference/com/google/mlkit/vision/objects/ObjectDetectorOptionsBase#SINGLE_IMAGE_MODE) | It is designed for single images where the detection of each image is independent. |\n| int | [STREAM_MODE](/android/reference/com/google/mlkit/vision/objects/ObjectDetectorOptionsBase#STREAM_MODE) | It is designed for streaming frames from video or camera. |\n\n### Public Method Summary\n\n|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| boolean | [equals](/android/reference/com/google/mlkit/vision/objects/ObjectDetectorOptionsBase#equals(java.lang.Object))([Object](//developer.android.com/reference/java/lang/Object.html) o) Indicates whether some other object is \"equal to\" this one. |\n| int | [hashCode](/android/reference/com/google/mlkit/vision/objects/ObjectDetectorOptionsBase#hashCode())() Returns a hash code value for the object. |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nConstants\n---------\n\n#### public static final int\n**SINGLE_IMAGE_MODE**\n\nIt is designed for single images where the detection of each image is independent.\nIn this mode, the detector would return detection results slower than [STREAM_MODE](/android/reference/com/google/mlkit/vision/objects/ObjectDetectorOptionsBase#STREAM_MODE). \nConstant Value: 2 \n\n#### public static final int\n**STREAM_MODE**\n\nIt is designed for streaming frames from video or camera. In this mode, the detector\nwould return the detection results faster than [SINGLE_IMAGE_MODE](/android/reference/com/google/mlkit/vision/objects/ObjectDetectorOptionsBase#SINGLE_IMAGE_MODE), since it leverages the detection results from previous\nimages. Therefore, it may not return results for a new object in the first few frames\nafter a new object appears in the images, since there is no previous result about this\nobject to help.\n\nNote that if the time-interval between two consecutive frames is too large, say\nseveral hundred milliseconds, the previous detected objects would be lost and all\nobjects would be treated as new objects. \nConstant Value: 1\n\nPublic Methods\n--------------\n\n#### public boolean **equals** ([Object](//developer.android.com/reference/java/lang/Object.html) o)\n\nIndicates whether some other object is \"equal to\" this one. \n\n#### public int **hashCode** ()\n\nReturns a hash code value for the object."]]