Skip to content

Commit

Permalink
Fixes #232 tbh idk what the problem is but this change seems reasonab…
Browse files Browse the repository at this point in the history
…le so 🤷
  • Loading branch information
dbolya committed Feb 25, 2020
1 parent ca36f90 commit b5a2e23
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion data/coco.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,16 @@ def pull_item(self, index):
img_id = self.ids[index]

if self.has_gt:
# What is this and why is this here? The targets are being loaded 2 lines down and that
# overwrites this, so why oh why is this here? What's the cause of this madness?
# But I can't risk it breaking things, so it stays. Is it mercy? No. It's fear.
target = self.coco.imgToAnns[img_id]


ann_ids = self.coco.getAnnIds(imgIds=img_id)

# Target has {'segmentation', 'area', iscrowd', 'image_id', 'bbox', 'category_id'}
target = self.coco.loadAnns(ann_ids)
target = [x for x in self.coco.loadAnns(ann_ids) if x['image_id'] == img_id]
else:
target = []

Expand Down

2 comments on commit b5a2e23

@jasonkena
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to work without line 115 just fine

@dbolya
Copy link
Owner Author

@dbolya dbolya commented on b5a2e23 Feb 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok that's it, I've had it with line 115. It's gotta go.

Please sign in to comment.