Package ai.djl.modality.cv
Class MultiBoxDetection.Builder
- java.lang.Object
-
- ai.djl.modality.cv.MultiBoxDetection.Builder
-
- Enclosing class:
- MultiBoxDetection
public static final class MultiBoxDetection.Builder extends java.lang.ObjectThe Builder to construct aMultiBoxDetectionobject.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MultiBoxDetectionbuild()Builds aMultiBoxDetectionblock.MultiBoxDetection.BuilderoptBackgroundId(int backgroundId)Sets the class ID for the background.MultiBoxDetection.BuilderoptClip(boolean clip)Sets the boolean parameter that indicates whether to clip out-of-boundary boxes.MultiBoxDetection.BuilderoptForceSuppress(boolean forceSuppress)Sets the boolean parameter that indicates whether to suppress all detections regardless of class_id.MultiBoxDetection.BuilderoptNmsThreshold(float nmsThreshold)Sets the non-maximum suppression(NMS) threshold.MultiBoxDetection.BuilderoptNmsTopK(int nmsTopK)Sets the boolean parameter that indicates whether to clip out-of-boundary boxes.MultiBoxDetection.BuilderoptThreshold(float threshold)Sets the threshold score for a detection to be a positive prediction.
-
-
-
Method Detail
-
optClip
public MultiBoxDetection.Builder optClip(boolean clip)
Sets the boolean parameter that indicates whether to clip out-of-boundary boxes. It is set totrueby default.- Parameters:
clip- whether to clip out-of-boundary boxes- Returns:
- this
Builder
-
optForceSuppress
public MultiBoxDetection.Builder optForceSuppress(boolean forceSuppress)
Sets the boolean parameter that indicates whether to suppress all detections regardless of class_id. It is set tofalseby default.- Parameters:
forceSuppress- whether to suppress all detections regardless of class_id- Returns:
- this
Builder
-
optBackgroundId
public MultiBoxDetection.Builder optBackgroundId(int backgroundId)
Sets the class ID for the background. Defaults to 0.- Parameters:
backgroundId- the class ID for the background- Returns:
- this
Builder
-
optNmsTopK
public MultiBoxDetection.Builder optNmsTopK(int nmsTopK)
Sets the boolean parameter that indicates whether to clip out-of-boundary boxes. Defaults to -1 which implies that there is no limit.- Parameters:
nmsTopK- whether to clip out-of-boundary boxes- Returns:
- this
Builder
-
optThreshold
public MultiBoxDetection.Builder optThreshold(float threshold)
Sets the threshold score for a detection to be a positive prediction. Defaults to 0.01.- Parameters:
threshold- the threshold score for a detection to be a positive prediction- Returns:
- this
Builder
-
optNmsThreshold
public MultiBoxDetection.Builder optNmsThreshold(float nmsThreshold)
Sets the non-maximum suppression(NMS) threshold. Defaults to 0.5.- Parameters:
nmsThreshold- the non-maximum suppression(NMS) threshold- Returns:
- this
Builder
-
build
public MultiBoxDetection build()
Builds aMultiBoxDetectionblock.- Returns:
- the
MultiBoxDetectionblock
-
-