Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Training Negative Samples #20

Open
mmaaz60 opened this issue Feb 26, 2020 · 1 comment
Open

Support for Training Negative Samples #20

mmaaz60 opened this issue Feb 26, 2020 · 1 comment

Comments

@mmaaz60
Copy link

mmaaz60 commented Feb 26, 2020

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

@Aenteas
Copy link

Aenteas commented Feb 29, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants