SegNet: A Deep Convolutional Encoder-Decoder Architecture for Image Segmentation 视频语义分割

 

 

先进入到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 

 

 

SegNet: A Deep Convolutional Encoder-Decoder Architecture for Image Segmentation 视频语义分割_第1张图片

 

说明:
第四个运行命令中的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


搞定~~~

你可能感兴趣的:(计算机视觉,DeepLearning)