目标检测算法SSD在Ubuntu+CPU下运行

具体怎样配置caffe以及下载检测model网上有很多教程,这里只介绍如何修改代码使程序可以在CPU执行

定位到/caffe-ssd/examples/ssd/ssd_detect.py,修改如下

源代码

# Make sure that caffe is on the python path:
caffe_root = './'

改为(我把caffe-ssd文件夹放在了主目录home下)

# Make sure that caffe is on the python path:
# caffe_root = './'
caffe_root = '~/caffe-ssd'

注释掉以下代码

#caffe.set_device(gpu_id)
#caffe.set_mode_gpu()

在终端输入如下命令

cd ~/caffe-ssd
python examples/ssd/ssd_detect.py

运行结果会自动保存在/caffe-ssd文件夹下的detect_result.jpg
目标检测算法SSD在Ubuntu+CPU下运行_第1张图片


另外附上"SSD_Single Shot MultiBox Detector" 论文及代码

论文 http://download.csdn.net/download/majinlei121/9996965
代码 http://download.csdn.net/download/majinlei121/9996951

你可能感兴趣的:(目标检测)