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

how to use the images contains no objects? #898

Open
liyheart opened this issue Jun 21, 2018 · 8 comments
Open

how to use the images contains no objects? #898

liyheart opened this issue Jun 21, 2018 · 8 comments

Comments

@liyheart
Copy link

In my setting, there are some images contain some persons and some images no persons(background images). how can i use all of them for training the yolo? Should I add empty txt files for the background images?

@AlexeyAB
Copy link
Collaborator

Should I add empty txt files for the background images?

Yes.

https://github.com/AlexeyAB/darknet#how-to-improve-object-detection

desirable that your training dataset include images with non-labeled objects that you do not want to detect - negative samples without bounded box (empty .txt files) - use as many images of negative samples as there are images with objects

@ErolCitak
Copy link

ErolCitak commented Jan 25, 2019

Should i give background images as an another class? For example, if i want to detect cars, i should have a bunch of images with car with label 1. But when i add background images, should i create only empty file and configure my yolo_voc.cfg file's class value as a 1 or 2?

For example; because of i have 1 class, my file consists; classes=1 and filters=30. But did i do classes=2 and filters=35. (i'm talking about Yolov2)

Thank you @AlexeyAB

@Chida15
Copy link

Chida15 commented Aug 4, 2019

Should i give background images as an another class? For example, if i want to detect cars, i should have a bunch of images with car with label 1. But when i add background images, should i create only empty file and configure my yolo_voc.cfg file's class value as a 1 or 2?

For example; because of i have 1 class, my file consists; classes=1 and filters=30. But did i do classes=2 and filters=35. (i'm talking about Yolov2)

Thank you @AlexeyAB

how did you deal with it? I also met this problem.

@dasmehdix
Copy link

Do we have to add the negative image paths to the train.txt file?

@Chida15
Copy link

Chida15 commented Aug 6, 2019

Do we have to add the negative image paths to the train.txt file?

Yes, you are supposed to add it to your train.txt

@ducheng678
Copy link

ducheng678 commented Aug 26, 2019

How does yolo use these empty labels to calculate loss?
One told me that these empty labels will be coded as a point [0,0,0,0,1] in background. But I`m confused about that.

@nathnim
Copy link

nathnim commented Apr 1, 2020

Dear all, can the negative images be added to both train.txt and valid.txt? Thanks!

@robisen1
Copy link

robisen1 commented Aug 6, 2020

Dear all, can the negative images be added to both train.txt and valid.txt? Thanks!

yes. that's what i do.

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

8 participants