Browse Source

[Enhancement] Add possible cause to x1<=x2 warning

Add a cause to this warning that is possible and may not be very easy to notice. May save users some time debugging the issue
Lin Han 3 năm trước cách đây
mục cha
commit
9aad8d1bc1
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      paddlex/cv/datasets/voc.py

+ 2 - 1
paddlex/cv/datasets/voc.py

@@ -218,7 +218,8 @@ class VOCDetection(Dataset):
                     if not (x2 >= x1 and y2 >= y1):
                         logging.warning(
                             "Bounding box for object {} does not satisfy x1 <= x2 and y1 <= y2, "
-                            "so this object is skipped. xml file: {}".format(i, xml_file))
+                            "so this object is skipped. This error can be caused by specifying "
+                            "image width and height in wrong order. xml file: {}".format(i, xml_file))
                         continue
 
                     gt_bbox[i, :] = [x1, y1, x2, y2]