浏览代码

dataset修改,box大小边界

xue50 7 月之前
父节点
当前提交
901a0c8cc7
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      models/line_detect/dataset_LD.py

+ 4 - 4
models/line_detect/dataset_LD.py

@@ -54,12 +54,12 @@ def line_boxes1(target):
             else:
                 xmin = a[0] - 10
                 xmax = b[0] + 10
-            boxs.append([ymin, xmin, ymax, xmax])
+            boxs.append([min(ymin,0), min(xmin,0), max(ymax,512), max(xmax, 0)])
 
     # print(f'box:{boxs}')
-    if boxs == []:
-        print(f'box:{boxs}')
-        print(f'target:{target}')
+    # if boxs == []:
+    #     print(f'box:{boxs}')
+    #     print(f'target:{target}')
 
     return torch.tensor(boxs)