DeepLabV2是由Liang-Chieh Chen等提出的一个图像语义分割网络结构,其主要的创新点在于提出了Atrous convolution(带孔的卷积)结构,从而在增大感受野的同时防止了数据的冗余,提高了逐像素点分类精度,而在最顶层使用的全连接条件随机场(CRF)则精细化了分割边界,现在已经有很多的新的网络基于DeepLab提出.
原文地址: https://arxiv.org/abs/1606.00915
原作者给出了两个版本的DeepLab,一个是shell版本的 http://liangchiehchen.com/projects/DeepLab.html
一个是python版本的:https://github.com/TheLegendAli/DeepLab-Context
python版的好坑,一直是protobuf的版本不对,果断换原作者给的shell版.
由于官方给的.sh文件的下载地址下不了,所以我通过clonegithub上一个人的版本得到:
git clone https://github.com/xmojiao/deeplab_v2
接下来进入正题,安装和运行的步骤主要包含下面几点:
一.安装相关依赖库
matio: sudo apt-get install libmatio-dev
wget: sudo pip install wget
二.编译deeplab版本的caffe
在https://bitbucket.org/aquariusjay/deeplab-public-ver2/overview下载官方给出的源码,然后解压到文件夹aquariusjay-deeplab/code中,在源码中像安装BVLC版本的caffe一样复制Makefile.config文件并进行修改,接着依次运行:
make all -j8
make test
make runtest -j8
make pycaffe
最后添加deeplab版本caffe的python路径到环境变量中.
用source~/.bashrc 生效
三.添加相应的模型文件和prototxt文件
在终端运行(默认你的deeplab源码是clone到deeplab这个目录下):
mkdir -p ~/deeplab/exper/voc12/config/deeplab_largeFOV
mkdir -p ~/deeplab/exper/voc12/features/labels
mkdir -p ~/deeplab/exper/voc12/features2/labels
mkdir -p ~/deeplab/exper/voc12/list
mkdir -p ~/deeplab/exper/voc12/log
mkdir -p ~/deeplab/exper/voc12/model/deeplab_largeFOV
mkdir -p ~/deeplab/exper/voc12/res
创建好目录之后,