output: (N, 5+class) shape
(output, scale_range)
| 20 | |
| 21 | |
| 22 | def filter_box(output, scale_range): |
| 23 | """ |
| 24 | output: (N, 5+class) shape |
| 25 | """ |
| 26 | min_scale, max_scale = scale_range |
| 27 | w = output[:, 2] - output[:, 0] |
| 28 | h = output[:, 3] - output[:, 1] |
| 29 | keep = (w * h > min_scale * min_scale) & (w * h < max_scale * max_scale) |
| 30 | return output[keep] |
| 31 | |
| 32 | |
| 33 | def postprocess(prediction, num_classes, conf_thre=0.7, nms_thre=0.45): |
nothing calls this directly
no outgoing calls
no test coverage detected