This is a fully-connected network(8 strides) implementation on the dataset ADE20k, using tensorflow.
The implementation is largely based on the paper arXiv: Fully Convolutional Networks for Semantic Segmentation and 2 implementation from other githubs: FCN.tensorflow and semantic-segmentation-pytorch.
net | dataset | competition | framework | arXiv paper |
---|---|---|---|---|
FCN8s | ADE20k | MIT Scene Parsing Benchmark (SceneParse150) | tensorflow 1.4 and python 3.6 | arXiv: Fully Convolutional Networks for Semantic Segmentation |
FCN_train.py
FCN_test.py
.
It will test the first 100 validation images by default. The validation dataset contains 2000 images, so if you want to test more images, simply modified the variable TEST_NUM
, e.g. 1000.FCN_infer.py
, it will process all .jpg images under ./infer and put the predicted annotations under ./output scipy.misc.imresize
to resize.
The function param interp
(interpolation) for resizing images is "bilinear"
, while that for resizing annotations is "nearest"
.When you run FCN_train.py
, you will see:
When you run FCN_test.py
, you will see:
After processing all validation images, It will print the metrics.
You can uncomment lines 130~143 to see some well processed results.
Just put the .jpg images in ./infer, run ./FCN_infer.py and the predicted annotations will be put in ./output.
The metrics of testing 100 validation images is:
pixel_accuracy | mean_accuracy | mean IU(mean iou) | frequency weighted IU |
---|---|---|---|
0.6739 | 0.4332 | 0.3644 | 0.5024 |
(There are 151 classes, where class index 0 is "others". You just need to care the accuracy on the 150 classes)
Here are some examples:
以上两个链接是我写的两个关于FCN的学习报告。 第二个学习报告写的比较早,关于代码的部分可以选择性地看,因为很多代码已经大改了。 第一个报告是根据这份代码写成的,更具参考性