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.Object
The Builder to construct aMultiBoxDetection
object.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MultiBoxDetection
build()
Builds aMultiBoxDetection
block.MultiBoxDetection.Builder
optBackgroundId(int backgroundId)
Sets the class ID for the background.MultiBoxDetection.Builder
optClip(boolean clip)
Sets the boolean parameter that indicates whether to clip out-of-boundary boxes.MultiBoxDetection.Builder
optForceSuppress(boolean forceSuppress)
Sets the boolean parameter that indicates whether to suppress all detections regardless of class_id.MultiBoxDetection.Builder
optNmsThreshold(float nmsThreshold)
Sets the non-maximum suppression(NMS) threshold.MultiBoxDetection.Builder
optNmsTopK(int nmsTopK)
Sets the boolean parameter that indicates whether to clip out-of-boundary boxes.MultiBoxDetection.Builder
optThreshold(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 totrue
by 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 tofalse
by 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 aMultiBoxDetection
block.- Returns:
- the
MultiBoxDetection
block
-
-