ijkguo / mx-rcnn

Parallel Faster R-CNN implementation with MXNet.
Other
671 stars 290 forks source link

Unable to detect second object #105

Open Ram-Godavarthi opened 6 years ago

Ram-Godavarthi commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

@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 commented 6 years ago

https://github.com/ijkguo/mx-rcnn/blob/dff47b8c4bee1121ce74414ec06f170eafac06e1/symimdb/pascal_voc.py#L165 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: https://github.com/ijkguo/mx-rcnn/commit/612d7c97f33031df3ceffb511042e30e57f4a2d1. Thanks for reporting it: nothing was wrong with your training.

Ram-Godavarthi commented 6 years ago

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 commented 6 years ago

OK so it is a different problem now. Based on https://github.com/ijkguo/mx-rcnn/issues/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 commented 6 years ago

No, i have 1000 images of each class now.. but still i am not able to detect the second object.

On Fri 3. Aug 2018 at 11:15 PM, Jian Guo notifications@github.com wrote:

OK so it is a different problem now. Based on #95 https://github.com/ijkguo/mx-rcnn/issues/95, you have 200 images in your training set, 200 images in your testing set. I think more data is better for generalization.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ijkguo/mx-rcnn/issues/105#issuecomment-410378334, or mute the thread https://github.com/notifications/unsubscribe-auth/Al2--9N3oOGrnbXzKqgR40QssFvdPCLPks5uNL1WgaJpZM4VqLzR .

ijkguo commented 6 years ago

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 commented 6 years ago

I have training set with sigle object in each image. So only one bounding box per image.

But while doing inference, i have dataset of images with 2 targets in single image..

But if i do train the network n then test them, Both the objects are detected as Pedestrian itself. Even if single object bicycle present sometimes, It is also detecting as pedestrian.

On Fri 3. Aug 2018 at 11:39 PM, Jian Guo notifications@github.com wrote:

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?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ijkguo/mx-rcnn/issues/105#issuecomment-410383272, or mute the thread https://github.com/notifications/unsubscribe-auth/Al2--x8NlonuCCsF7P11dhvEEyFjGliyks5uNMMogaJpZM4VqLzR .