-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
Make R-CNN the Caffe detection example #482
Conversation
Note that I've added a further example image for detection. A further ilsvrc auxiliary file is needed too, |
@sergeyk you may want to review too since you wrote the original detection example. |
Thanks for updating this! I'll take a look at it tomorrow. On Sun, Jun 8, 2014 at 9:07 PM, Evan Shelhamer notifications@github.com
|
Looks good to me On Sun, Jun 8, 2014 at 10:25 PM, Ross Girshick notifications@github.com
|
@sergeyk could you update the NMS function to match R-CNN as you and Ross have talked about?
and give it a test? Currently it seems to be returning the wrong windows. If you look at the output the boxes are not the top scoring boxes. Please push the changes directly to my fork to include them in this PR. |
Hi Evan, I want to make sure that the Caffe R-CNN demo outputs the same results (or One that comes to mind is that prior to doing selective search, I resize For reference, I'm using the R-CNN model at When I run R-CNN, I end up with the following detections in this image (top [image: Inline image 1] On Mon, Jun 9, 2014 at 11:54 AM, Evan Shelhamer notifications@github.com
|
- caffe.Detector learned how to crop windows with context in the R-CNN style s.t. the bordero of the network input is a given amount of context. - add --context_pad arg to detect.py for amount of context. Default is 16, as in R-CNN.
@sergeyk is it alright with you if a push a |
Included @sergeyk's latest NMS code |
Yeah for sure On Monday, June 9, 2014, Evan Shelhamer notifications@github.com wrote:
|
@rbgirshick I made the fixes we talked about offline and proposals are now collected with the R-CNN configuration of selective search. Please take another look when you have a chance. Thanks for your help! |
Did you figure out the issue with the NMS update (if there was one)? On Mon, Jun 9, 2014 at 9:41 PM, Evan Shelhamer notifications@github.com
|
I was able to go through the notebook and the output looks close enough to In the detection notebook the text about 190 proposals needs to be updated In the last part, with the NMS'd bicycle examples, it would be better to Otherwise, it looks good! On Mon, Jun 9, 2014 at 9:54 PM, Ross Girshick rbg@eecs.berkeley.edu wrote:
|
The plotting was wrong haha. The usual X vs. Y conspiracy. Le lundi 9 juin 2014, Ross Girshick notifications@github.com a écrit :
|
The resizing to width 500 is here: Apologies for the the mixing of configuration across repos, but I figured Thanks for the catches and suggestions for the text -- I'll follow up with Le lundi 9 juin 2014, Ross Girshick notifications@github.com a écrit :
|
- run through and save new output - collect region proposals with R-CNN configuration (see sergeyk/selective_search_ijcv_with_python) - call detect.py in GPU mode - fix NMS plotting: X and Y coords were accidentally exchanged. print scores too.
@rbgirshick I amended the last commit to address your comments. Is everyone ok with merging then cherry-picking this example to master? |
Looks good! On Tue, Jun 10, 2014 at 10:17 AM, Evan Shelhamer notifications@github.com
|
This means that we need to first |
On a machine with 8GB memory and four CPU cores, I compiled Caffe with In the tutorial, the timing result is "Processed 223 windows in 16.525 s". What could be the cause of the performance discrepancy? |
Was the example run on GPU? Could you provide the download link to the resultant |
Note that selective search is not part of Caffe and is distributed as Le mercredi 11 juin 2014, kloudkl notifications@github.com a écrit :
|
Yes, the ~1600 windows were run on GPU. If you check the example text, Le mercredi 11 juin 2014, kloudkl notifications@github.com a écrit :
|
If you are interested we are integrating bing objectness[1] in opencv with one of this year GSOC |
Merging -- will follow-up to port to master later (so that the public example is R-CNN). |
Make R-CNN the Caffe detection example
@bhack please let us know once your region proposal method is in opencv. I'd be interested in seeing the performance of our models with bing objectness vs. selective search -- and of course open and fast code is better than not. |
I looked into trying bing out a month or so ago, but found that it was On Wed, Jun 11, 2014 at 6:09 PM, Evan Shelhamer notifications@github.com
|
It would be great if we could make the python caffe R-CNN demo faster so that it's closer to the speed of the reference matlab version. On my machine (six-core i7; k20) it runs quite slowly. I added some timing statements to the code, which reveals that it spends a large amount of time cropping and pre-processing windows and very little inside Caffe doing forward. Timing in GPU mode The matlab version takes about 12.5s versus 74s above. I don't know enough python to understand if this to be expected or if there are some obvious ways to easily improve speed. Thoughts? (Also, it might be good for someone else to verify these timings in case something is messed up on my machine vis-a-vis my python installation.) |
Thanks for the timing analysis Ross. I'll try to investigate the image Le mercredi 11 juin 2014, Ross Girshick notifications@github.com a écrit :
|
We tried BING two weeks ago. I remember that BING's password is mmcheng.net, http://mmcheng.net or http://mmcheng.net/. It is fast but you have tell it where are the targets for it to detect the wanted objects. |
The hot spot lines of python code can be found by the profilers. |
The detector induces memory swap. Thus it can't be profiled correctly. Instead, I profiled the classification demo. The most time consuming function/method calls are as follows.
|
@kloudkl What do you mean with "you have tell it where are the targets for it to detect the wanted objects."? |
Initialize the detector with the possible positions of the objects. |
I don't undertstand... Bing generally give you 1000 candidate windows with a detection rate of 96% |
Maybe we did something wrong. We'll give it another shot recently. |
The likely culprit for the input preprocessing slowdown is the list comprehension preprocessing one-by-one instead of doing it batch. @sergeyk although you like the composition of |
@shelhamer @rbgirshick @kloudkl The initial BING opencv gsoc porting is here. It still doesn't have the training component ported but we have shared trained Mat and a sample. Any feedback is welcome. cc:@vpisarev |
There was an extra character in the Bing repository link. Now it is fixed. |
Take a look also to this http://arxiv.org/abs/1406.4729v1 |
Make R-CNN the Caffe detection example
@rbgirshick Any plan to contribute back FAST-RCNN? How precomputed proposal are actually generated? |
@bhack I'm happy to contribute any useful bits of Fast R-CNN to Caffe. On my side (for now at least), I need to jump through some hoops to get permission to do a PR. However, the Fast R-CNN code is all MIT licensed, so anyone can contribute it to Caffe if there's demand. Personally, I don't think it makes sense to include all of Fast R-CNN in Caffe, but it would be nice if it worked out of the box with Caffe master. That would require merging some new layers (smooth l1, roi pooling). Precomputed proposals used this code: https://github.com/rbgirshick/rcnn/tree/master/selective_search. |
@rbgirshick Ok i've opened a new issue at #2411 with a link to an evaluation of some others object proposal algorithms because I think that selective search it is still closed source. |
@bhack Use of selective search is largely for apples-to-apples comparison with previous published work. I'm going to look into using LPO (CVPR'15 paper; http://www.philkr.net/home/lpo), which has open source Python code. |
@rbgirshick Thank you for point to LPO. I've updated the issue. |
R-CNN [1] is a state-of-the-art detector powered by a finetuned Caffe model. As an off-the-shelf example, I have made a pure Caffe version of R-CNN, ILSVRC13 detection edition, by
Detector
@rbgirshick please review to make sure that everything is clear. Thanks!