Skip to content

Commit

Permalink
modify the -1 bug in utils/IoU.py
Browse files Browse the repository at this point in the history
  • Loading branch information
tzzcl committed Jun 11, 2020
1 parent 6862599 commit f8bee83
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions utils/IoU.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ def get_gt_boxes(xmlfile):
gt_boxes = []
for obj in objs:
bbox = obj.find('bndbox')
x1 = float(bbox.find('xmin').text)-1
y1 = float(bbox.find('ymin').text)-1
x2 = float(bbox.find('xmax').text)-1
y2 = float(bbox.find('ymax').text)-1
x1 = float(bbox.find('xmin').text)
y1 = float(bbox.find('ymin').text)
x2 = float(bbox.find('xmax').text)
y2 = float(bbox.find('ymax').text)

gt_boxes.append((x1, y1, x2, y2))
return gt_boxes
Expand All @@ -29,10 +29,10 @@ def get_cls_gt_boxes(xmlfile, cls):
#print(cls_name, cls)
if cls_name != cls:
continue
x1 = float(bbox.find('xmin').text)-1
y1 = float(bbox.find('ymin').text)-1
x2 = float(bbox.find('xmax').text)-1
y2 = float(bbox.find('ymax').text)-1
x1 = float(bbox.find('xmin').text)
y1 = float(bbox.find('ymin').text)
x2 = float(bbox.find('xmax').text)
y2 = float(bbox.find('ymax').text)

gt_boxes.append((x1, y1, x2, y2))
if len(gt_boxes)==0:
Expand Down

0 comments on commit f8bee83

Please sign in to comment.