Explorar o código

do not plus 1 while computing w and h for bbox

will-jl944 %!s(int64=4) %!d(string=hai) anos
pai
achega
c5e9fe9c98
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      dygraph/paddlex/cv/datasets/voc.py

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

@@ -216,8 +216,8 @@ class VOCDetection(Dataset):
                     annotations['annotations'].append({
                         'iscrowd': 0,
                         'image_id': int(im_id[0]),
-                        'bbox': [x1, y1, x2 - x1 + 1, y2 - y1 + 1],
-                        'area': float((x2 - x1 + 1) * (y2 - y1 + 1)),
+                        'bbox': [x1, y1, x2 - x1, y2 - y1],
+                        'area': float((x2 - x1) * (y2 - y1)),
                         'category_id': cname2cid[cname] + 1,
                         'id': ann_ct,
                         'difficult': _difficult