Fully Convolutional Networks[1] implemented in PyTorch. Although [2], [3] have implemeted it very well, the purpose of this repository is for me to gain familarity with semantic segmentation with pytorch implementations. Some of the code are borrowed from [2], [3], [4]. Thanks them very much.
- python 3.6
- pytorch==0.3.0, torchvision, scipy, ...
Note:
-
All the code are developed and tested on Python 3.6 and maybe not support Python 2.x
-
You can install all the python packages one-line by running:
sudo pip3 install -r requirements.txt
Support Pascal VOC 2012 dataset.
- Download data by running:
wget http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCtrainval_11-May-2012.tar
wget http://www.eecs.berkeley.edu/Research/Projects/CS/vision/grouping/semantic_contours/benchmark.tgz
- Extract the VOCtrainval_11-May-2012.tar and benchmark_RELEASE.tgz, modify the data path in config.py.
- To train the model:
python main.py --phase train
- To val the model:
python main.py --phase val
- To test
python main.py --phase test --in_path xxx/xxx.jpg --out_path ./results/
Displayed Raw jpg | Displayed Ground truth label | Displayed Predictions jpg |
[2] https://github.com/wkentaro/pytorch-fcn