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

来源:互联网 发布:初中数学解题软件 编辑:程序博客网 时间:2024/06/05 04:31

具体怎样配置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-ssdpython examples/ssd/ssd_detect.py

运行结果会自动保存在/caffe-ssd文件夹下的detect_result.jpg


另外附上"SSD_Single Shot MultiBox Detector" 论文及代码论文 http://download.csdn.net/download/majinlei121/9996965代码 http://download.csdn.net/download/majinlei121/9996951