nms
non_max_suppression_fast(boxes, overlapThresh)
¶
Applies non-maximum suppression to bounding boxes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
boxes
|
ndarray
|
Array of bounding boxes with confidence scores. |
required |
overlapThresh
|
float
|
Overlap threshold for suppression. |
required |
Returns:
Name | Type | Description |
---|---|---|
list |
List of bounding boxes after non-maximum suppression. |
Source code in inference/core/nms.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 |
|
w_np_non_max_suppression(prediction, conf_thresh=0.25, iou_thresh=0.45, class_agnostic=False, max_detections=300, max_candidate_detections=3000, timeout_seconds=None, num_masks=0, box_format='xywh')
¶
Applies non-maximum suppression to predictions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prediction
|
ndarray
|
Array of predictions. Format for single prediction is [bbox x 4, max_class_confidence, (confidence) x num_of_classes, additional_element x num_masks] |
required |
conf_thresh
|
float
|
Confidence threshold. Defaults to 0.25. |
0.25
|
iou_thresh
|
float
|
IOU threshold. Defaults to 0.45. |
0.45
|
class_agnostic
|
bool
|
Whether to ignore class labels. Defaults to False. |
False
|
max_detections
|
int
|
Maximum number of detections. Defaults to 300. |
300
|
max_candidate_detections
|
int
|
Maximum number of candidate detections. Defaults to 3000. |
3000
|
timeout_seconds
|
Optional[int]
|
Timeout in seconds. Defaults to None. |
None
|
num_masks
|
int
|
Number of masks. Defaults to 0. |
0
|
box_format
|
str
|
Format of bounding boxes. Either 'xywh' or 'xyxy'. Defaults to 'xywh'. |
'xywh'
|
Returns:
Name | Type | Description |
---|---|---|
list |
List of filtered predictions after non-maximum suppression. Format of a single result is: [bbox x 4, max_class_confidence, max_class_confidence, id_of_class_with_max_confidence, additional_element x num_masks] |
Source code in inference/core/nms.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
|