Spaces:
Runtime error
Runtime error
oskarastrom
commited on
Commit
•
ea6a784
1
Parent(s):
54a00fb
Update inference.py
Browse files- inference.py +3 -1
inference.py
CHANGED
@@ -464,7 +464,9 @@ def non_max_suppression(
|
|
464 |
prediction = prediction.cpu()
|
465 |
bs = prediction.shape[0] # batch size
|
466 |
xc = prediction[..., 4] > conf_thres # candidates
|
467 |
-
|
|
|
|
|
468 |
width = prediction[..., 2]*pix2width
|
469 |
wc = width < max_length
|
470 |
|
|
|
464 |
prediction = prediction.cpu()
|
465 |
bs = prediction.shape[0] # batch size
|
466 |
xc = prediction[..., 4] > conf_thres # candidates
|
467 |
+
|
468 |
+
# width filter
|
469 |
+
pix2width = image_meter_width/image_pixel_width
|
470 |
width = prediction[..., 2]*pix2width
|
471 |
wc = width < max_length
|
472 |
|