Package ai.djl.modality.cv
Class MultiBoxDetection.Builder
java.lang.Object
ai.djl.modality.cv.MultiBoxDetection.Builder
- Enclosing class:
- MultiBoxDetection
The Builder to construct a
MultiBoxDetection object.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds aMultiBoxDetectionblock.optBackgroundId(int backgroundId) Sets the class ID for the background.optClip(boolean clip) Sets the boolean parameter that indicates whether to clip out-of-boundary boxes.optForceSuppress(boolean forceSuppress) Sets the boolean parameter that indicates whether to suppress all detections regardless of class_id.optNmsThreshold(float nmsThreshold) Sets the non-maximum suppression(NMS) threshold.optNmsTopK(int nmsTopK) Sets the boolean parameter that indicates whether to clip out-of-boundary boxes.optThreshold(float threshold) Sets the threshold score for a detection to be a positive prediction.
-
Method Details
-
optClip
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
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
Sets the class ID for the background. Defaults to 0.- Parameters:
backgroundId- the class ID for the background- Returns:
- this
Builder
-
optNmsTopK
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
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
Sets the non-maximum suppression(NMS) threshold. Defaults to 0.5.- Parameters:
nmsThreshold- the non-maximum suppression(NMS) threshold- Returns:
- this
Builder
-
build
Builds aMultiBoxDetectionblock.- Returns:
- the
MultiBoxDetectionblock
-