Prechádzať zdrojové kódy

style: 修复坐标转换代码的换行格式

修复了坐标转换代码中不必要的换行,以提高代码的可读性和一致性。
Hannnk 6 dní pred
rodič
commit
e192c19be2
1 zmenil súbory, kde vykonal 2 pridanie a 1 odobranie
  1. 2 1
      src/core/inference.py

+ 2 - 1
src/core/inference.py

@@ -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)