SegNet: A Deep Convolutional Encoder-Decoder Architecture for Image Segmentation 視頻語義分割demo跑通


先進入到https://github.com/TimoSaemann/caffe-segnet-cudnn5,下載caffe-segnet-cudnn5-master.zip
再進入到https://github.com/alexgkendall/SegNet-Tutorial 再下載SegNet-Tutorial-master.zip
准備工作:
1.先准備opencv,我測試的是opencv3.1.0

2.進入到caffe-segnet-cudnn5-master文件夾,編譯它修改版的caffe(caffe-segnet-cudnn5-master這個文件夾)
命令如下:
cd caffe-segnet-cudnn5-master
cp Makefile.config.example Makefile.config 
gedit Makefile.config
修改內容:
USE_CUDNN := 1 
USE_OPENCV := 1
OPENCV_VERSION := 3  
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu/hdf5/serial

make -j8
make pycaffe

3.編譯完成后,進入到SegNet-Tutorial-master文件夾,修改webcam_demo.py
第十四行:
#caffe_root = '/SegNet/caffe-segnet/'
caffe_root = '/home/ubuntu/Desktop/video semantic segmentation/SegNet and Bayesian SegNet Tutorial/caffe-segnet-cudnn5-master/'
#cap = cv2.VideoCapture(0) # Change this to your webcam ID, or file name for your video file
cap = cv2.VideoCapture("/home/ubuntu/Desktop/video semantic segmentation/SegNet and Bayesian SegNet Tutorial/SegNet-Tutorial-master/Scripts/0006R0.MXF")

4.運行命令:進入到SegNet-Tutorial-master文件夾
python Scripts/webcam_demo.py --model Example_Models/segnet_model_driving_webdemo.prototxt --weights Example_Models/segnet_weights_driving_webdemo.caffemodel --colours Scripts/camvid12.png 



說明:
第四個運行命令中的caffemodel模型可以替換的,有室內的訓練模型,也有室外的訓練模型,模型下載地址:
https://github.com/alexgkendall/SegNet-Tutorial/blob/master/Example_Models/segnet_model_zoo.md


相關網站:
https://github.com/alexgkendall/SegNet-Tutorial
http://mi.eng.cam.ac.uk/projects/segnet/#code
http://blog.csdn.net/u014451076/article/details/70741629?locationNum=1&fps=1
https://askubuntu.com/questions/784392/issues-with-nvidia-graphics-driver-and-cuda-after-apt-get-upgrade


搞定~~~

注意!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系我们删除。



 
粤ICP备14056181号  © 2014-2021 ITdaan.com