multimodallearning / pytorch-mask-rcnn

Other
2.01k stars 557 forks source link

Fixed a bug related to handling COCO crowds #66

Open pauloabelha opened 5 years ago

pauloabelha commented 5 years ago

The model.py code for dealing with COCO crowds was handling the list of negative class ids, by checking 'torch.nonzero(gt_class_ids < 0).size()'; this can lead to bugs as 'torch.nonzero([-1 -2 -3] < 0).size()' is actually True. A better way of checking is doing 'len(torch.nonzero([-1 -2 -3] < 0).size()) > 0', which now works.