So far, we have introduced methods such as BING and Selective Search as R-CNN. ・ Click here for past articles I tried using BING with OpenCV as pre-processing for CNN I tried using Selective search as R-CNN However, the accuracy of BING is not very good, There are still complaints about Selective Search, such as slow processing speed. So this time I would like to try Faster R-CNN.
It is a method that has been accelerated by detecting object candidates with CNN. Originally, a method called Fast R-CNN was announced earlier, Soon after, the faster Faster R-CNN was announced. (The speed of progress in this world is terrifying.) For details, please refer to the Cornnel University page. https://arxiv.org/abs/1506.01497
The original is Caffe https://github.com/rbgirshick/py-faster-rcnn/tree/96dc9f1dea3087474d6da5a98879072901ee9bf9 I don't want to use Caffe very much as a personal hobby, so this time I will use the Chainer version. https://github.com/mitmul/chainer-faster-rcnn
Environment: Ubuntu16.04LTS, Python2.7.12, Chainer1.12.0 Just follow the steps in the ReadMe.
□ Clone chainer-fast-neural style.
$ git clone https://github.com/mitmul/chainer-faster-rcnn
□ Go to the library folder and build
$ cd chainer-faster-rcnn/lib
$ python setup.py build_ext -i
$ cd ..
□ Download the trained model
$ if [ ! -d data ]; then mkdir data; fi; cd data
$ wget https://dl.dropboxusercontent.com/u/2498135/faster-rcnn/VGG16_faster_rcnn_final.model`
$ cd ..
□ Download and run the test image
$ wget http://vision.cs.utexas.edu/voc/VOC2007_test/JPEGImages/004545.jpg
$ python forward.py --img_fn 004545.jpg --gpu 0
It is the result of the test image This is an image I prepared myself Both are detected accurately. Furthermore, when using GTX970, it is detected in about 0.3 to 0.4 seconds. By the way, it took about 30 seconds for CPU only.
Faster R-CNN seems to be a pretty good technique at the moment. A graphics board is required. In the future, there will be lightweight models that will work on mobile devices as well.
[2016/11/30 postscript] If you think about it, there seems to be a faster method called Single Shot Multi-box Detection. https://arxiv.org/abs/1512.02325 I would like to try this in my spare time as well.
Recommended Posts