Skip to content

Commit 946ecd3

Browse files
committed
Fixed an coco evaluate error while training yourself dataset
1 parent 551ecc7 commit 946ecd3

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

tool/tv_reference/coco_eval.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ def loadRes(self, resFile):
273273
elif 'bbox' in anns[0] and not anns[0]['bbox'] == []:
274274
res.dataset['categories'] = copy.deepcopy(self.dataset['categories'])
275275
for id, ann in enumerate(anns):
276+
ann['bbox'] = ann['bbox'][0]
276277
bb = ann['bbox']
277278
x1, x2, y1, y2 = [bb[0], bb[0] + bb[2], bb[1], bb[1] + bb[3]]
278279
if 'segmentation' not in ann:

train.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ def evaluate(model, data_loader, cfg, device, logger=None, **kwargs):
490490
# outputs = outputs.cpu().detach().numpy()
491491
res = {}
492492
# for img, target, output in zip(images, targets, outputs):
493-
for img, target, (boxes, confs) in zip(images, targets, outputs):
493+
for img, target, boxes, confs in zip(images, targets, outputs[0], outputs[1]):
494494
img_height, img_width = img.shape[:2]
495495
# boxes = output[...,:4].copy() # output boxes in yolo format
496496
boxes = boxes.squeeze(2).cpu().detach().numpy()

0 commit comments

Comments
 (0)