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
If I wana detect small object, which args should I modify? #586
Comments
I am struggling with this as well, though my objects can be in a range from +/- 5 to 100 px with different ratios. Most of my initial effort was targeted at changing the parameters going into the anchor_target_layer and proposal_layer:
I made a script for analysing the images & boxes in your IMDB, it is available here: https://github.com/djdam/faster-rcnn-scenarios/blob/master/src/analysis/imdb_analyse.py |
@djdam wow that's cool! |
@albertyou2 @djdam: Reducing the value of the following configuration while training may help you create a model that detects small objects. Using 4 instead of default 16 helped in my case. You may also directly try changing the value at test time for your existing model at the following line. Not sure how good it would be though. |
hi @ravikantb I have read some issues and articles , and I heard a parameter named something like 'min scale' or 'aspect ratio' .But it's very difficult for me to find they out. |
@albertyou2 : My guess is the papers where you read about 'min scale' and 'aspect ratio' meant to refer to the anchor box ratios and scales. You will need to change them also (in addition to RPN_MIN_SIZE) to detect small objects. The default anchor boxes have 3 scales and 3 ratios (in total 9 anchor boxes for every position of feature map given by VGG/ZF convolution layers). Following method is called whenever reference to anchor boxes is needed: My suggestion would be to decrease the default ratios and scales. You can also add new ratios and scales in addition to default ones but then you will need to make some more changes in prototxts to account for change in RPN outputs triggered by change in anchor boxes. Let me know if you need any help in that. |
Thank you .I will have a try as your helpful suggestion! |
@djdam i run the imdb_analyse.py,but it occue some errors: File "imdb_analyse.py", line 30, in get_statistics |
technicaldrawings_numbers_train is the name for my dataset. You need to change it to your own dataset's name. about the width error, you need to modify your dataset factory Python file and add the missing keys to the roidb entries, like 'width', 'height' etc |
eg an example of a dataset factory is https://github.com/rbgirshick/py-faster-rcnn/blob/master/lib/datasets/pascal_voc.py . You probably have your own custom one. In the case of pascal_voc, you would need to add the height. width and filename keys in this line: https://github.com/rbgirshick/py-faster-rcnn/blob/master/lib/datasets/pascal_voc.py#L220 |
@djdam i add as fllow: |
looks good. Don't forget to delete the cached .pkl file |
@djdam thank you ,have a nice day |
@djdam Did you try to remove layer 'pool4' in VGG16 in terms of small object? I got low score. Considering pooling is one kind of down-sampling, why the result was worse? Thanks |
good job |
good job! |
@ravikantb ,if I have changed the anchor ratio and scale,what should I do accompanied ?should I change the feat_stride?or something else?thanks |
Hey @ravikantb and @djdam. I had a question regarding your modifications for detecting small objects. You said that changing ratios and decreasing scales would be a good idea. Isn't it possible to just reduce the base size of anchors while keeping all other parameters the same? For example, say the default anchors are (32,64,128,256,512), couldn't I just change it to (8,16,32,64,128) or (4,8,16,32,64) to detect smaller objects since the aspect ratios and scales are relative to the anchor size? |
Hey everybody, I have the same problem to detect very small object less than 10 pixels. Does this modification help me? I am using Faster rcnn by tensorflow |
yes this works for me, even for objects small than 10 pixels, I used (4,8,16,32,64) |
@rbgirshick
Thanks for your good work!
I wana detect very small objects , like 10 * 10 .But I don't know how to do this .
I have search the hole issue list but didn't see any compelete instructions for this job.
Could you please show me a way to do this?something like which args to modified
Thank you
The text was updated successfully, but these errors were encountered: