fast rcnn的安装与使用

来源:互联网 发布:淘宝营业额 编辑:程序博客网 时间:2024/05/17 04:42

fast rcnn的安装与使用

大致来自于:
https://github.com/rbgirshick/fast-rcnn
本文环境:ubuntu14.04
步骤如下:
1、确定你机器上安装有caffe,并且编译成功。安装过程可以参考博客中其他文章。
2、从githhub上下载程序:
可以使用:
# Make sure to clone with --recursivegit clone --recursive https://github.com/rbgirshick/fast-rcnn.git
3、更新:
git submodule update --init --recursive

4、编译cpython模块:
cd $FRCN_ROOT/libmake
5、编译caffe和pycaffe
cd $FRCN_ROOT/caffe-fast-rcnn# Now follow the Caffe installation instructions here:#   http://caffe.berkeleyvision.org/installation.html# If you're experienced with Caffe and have all of the requirements installed# and your Makefile.config in place, then simply do:(这步将你自己的caffe中makeFile.config文件拷贝过来)make -j8 && make pycaffe
6、下载作者编译好的模型:自己可以先不编译,你的硬件估计不够
cd $FRCN_ROOT./data/scripts/fetch_fast_rcnn_models.sh
7、运行demo程序
cd $FRCN_ROOT./tools/demo.py
若无cv2:
apt-get install python-opencv
若无easydict:
  sudo pip install  easydict
若显存不够,请在后面加--cpu
注:该程序中到proposals都存在mat中,若自己需要测试其他图像,需要先生存该文件,备选有:
  1. Selective Search: original matlab code, python wrapper
  2. EdgeBoxes: matlab code
  3. GOP and LPO: python code
  4. MCG: matlab code
  5. RIGOR: matlab code
最终结果展示:
在ubuntu下没有插件,图片无法上传.
Demo for data/demo/000004.jpg
Detection took 68.442s for 2888 object proposals
All car detections with p(car | box) >= 0.8
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Demo for data/demo/001551.jpg
Detection took 59.334s for 2057 object proposals
All sofa detections with p(sofa | box) >= 0.8
All tvmonitor detections with p(tvmonitor | box) >= 0.8
结果说明:在cpu下速度太慢,没有论文上那么快(毕竟人用到是k40,哈哈),demo中到效果相当不错。

0 0