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

Unable to detect second object #105

Open
Ram-Godavarthi opened this issue Aug 1, 2018 · 8 comments
Open

Unable to detect second object #105

Ram-Godavarthi opened this issue Aug 1, 2018 · 8 comments

Comments

@Ram-Godavarthi
Copy link

Hi @ijkguo ,
I have trained the model with resnet18.
I have given 2 classes.
when i run test.py. After 10 epochs
I am getting something like this..

INFO:root:Writing pedestrian VOC results file
INFO:root:Writing bicycle VOC results file
INFO:root:AP for background = 0.5177
INFO:root:AP for pedestrian = 0.2642
INFO:root:Mean AP = 0.3910

Unable to detect 2nd class.
What is the problem??

There is something wrong in the train.py?
Please clarify this..
Thanks in advance.

@ijkguo
Copy link
Owner

ijkguo commented Aug 1, 2018

Your custom classes seem to be background (index 0), pedestrian (index 1), bicycle (index 2). Please check the output labels to be 0, 1 or 2.

@Ram-Godavarthi
Copy link
Author

Ram-Godavarthi commented Aug 3, 2018

@ijkguo
I have changed the classes names in pascal_voc.py ..
I have included 'background', 'pedestrian', 'bicycle'.
Changed the class numbers to 3 in train and test, demo scripts.
I have used v6 branch...
So here the index 0 is background, index 1 ped and index 2 is bicycle... Correct??

It should work right? It is not happening..
Should i change anything else??

@ijkguo
Copy link
Owner

ijkguo commented Aug 3, 2018

for cls, ap in zip(self.classes, aps):

the background class was not skipped when printing the evaluation results, thus background was referring to the next class. In your case, 0.5177 is AP for pedestrian and 0.2642 is AP for bicycle. I made a fix here: 612d7c9.
Thanks for reporting it: nothing was wrong with your training.

@Ram-Godavarthi
Copy link
Author

I had thought the same..
i changed it and checked.
But when i run on some demo images 200+,
It is only detecting pedestrian, bicycle is not getting detected..
even if i run 25 epochs, it is not detecting..
I am completely stuck here from past few days..

@ijkguo
Copy link
Owner

ijkguo commented Aug 3, 2018

OK so it is a different problem now. Based on #95, you have 200 images in your training set, 200 images in your testing set. I think more data is better for generalization.

@Ram-Godavarthi
Copy link
Author

Ram-Godavarthi commented Aug 3, 2018 via email

@ijkguo
Copy link
Owner

ijkguo commented Aug 3, 2018

Let's look at training set first before evaluating generalization ability on testing set. Can you see more than one detection in a training image?

@Ram-Godavarthi
Copy link
Author

Ram-Godavarthi commented Aug 3, 2018 via email

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