修复了坐标转换代码中不必要的换行,以提高代码的可读性和一致性。
@@ -201,7 +201,8 @@ class ONNXDetector:
# 坐标转换
ratioh = self.orig_h / self.input_size[1]
ratiow = self.orig_w / self.input_size[0]
- detections[:, 2:6] *= np.array([ratiow, ratioh, ratiow, ratioh])
+ detections[:, 2
+ :6] *= np.array([ratiow, ratioh, ratiow, ratioh])
# NMS处理
keep = self.nms(detections[:, 2:6], detections[:, 1:2], self.confThreshold, 0.4)