mirror of
https://github.com/openmv/openmv.git
synced 2025-09-26 23:09:13 +08:00
scripts/libraries: Fix axis used for gathering bounding box results.
len(bb) returns the row count but bb.shape[0] is better to use.
This commit is contained in:
parent
3d6ea57ad4
commit
5ec0bcfdfa
@ -140,7 +140,7 @@ class yolo_v2_postprocess:
|
||||
h_rel = h_rel * ih
|
||||
|
||||
nms = NMS(iw, ih, inputs[0].roi)
|
||||
for i in range(len(bb)):
|
||||
for i in range(bb.shape[0]):
|
||||
nms.add_bounding_box(x_center[i] - (w_rel[i] / 2),
|
||||
y_center[i] - (h_rel[i] / 2),
|
||||
x_center[i] + (w_rel[i] / 2),
|
||||
@ -198,7 +198,7 @@ class yolo_v5_postprocess:
|
||||
ymax = (y_center + h_rel) * ih
|
||||
|
||||
nms = NMS(iw, ih, inputs[0].roi)
|
||||
for i in range(len(bb)):
|
||||
for i in range(bb.shape[0]):
|
||||
nms.add_bounding_box(xmin[i], ymin[i], xmax[i], ymax[i],
|
||||
bb_scores[i], bb_classes[i])
|
||||
return nms.get_bounding_boxes(threshold=self.nms_threshold, sigma=self.nms_sigma)
|
||||
|
Loading…
Reference in New Issue
Block a user