easy-faster-rcnn.pytorch icon indicating copy to clipboard operation
easy-faster-rcnn.pytorch copied to clipboard

Support for Training Negative Samples

Open mmaaz60 opened this issue 5 years ago • 1 comments

Hi,

Is this repository allow considering negative images as well for training? For example, while training a cat detector, one may have some images containing cats (+ve images) and some images do not containing cats (-ve images). I noticed that the training script only considers the positive images for training and discard others.

What would be the good way to add support for Negative Samples in training in this repository?

Best Regards, Maaz

mmaaz60 avatar Feb 26 '20 10:02 mmaaz60

Hi, Negative examples mean you have no label on the image, so none of the categories are present (I am not sure if you just want to add specific categorie(s)). Either way, you can do it by opening the script of your dataset class under dataset folder (for example coco2017_animal.py) and modifying the init function: remove line 90: if len(annotation) > 0: if you want to add negative examples At line 107 annotation.objects the code is monitoring for specific categories so you can add arbitrary classes there. Hope this helps

Aenteas avatar Feb 29 '20 09:02 Aenteas