fast rcnn的安装与使用

本文介绍如何在Ubuntu 14.04环境下安装并使用Fast R-CNN进行物体检测。主要内容包括:安装Caffe及编译配置、从GitHub下载Fast R-CNN源码、编译Python模块及Caffe、下载预训练模型、运行演示程序等步骤。

fast rcnn的安装与使用

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

4、编译cpython模块:
cd $FRCN_ROOT/lib
make
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 codepython 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中到效果相当不错。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值