U-NetでPascal VOC 2012の画像をSemantic Segmentationする (TensorFlow)

上記のサイトを参考に実践勉強した。 

理解用の自分メモです。

 

トレーニング検証データを解凍する

tar -xvf VOCtrainval_11-May-2012.tar

PEGImages

 

ダイレクトカラー画像とインデックスカラー画像

SegmentationClass JPEGImages

Index Class Index Class
0 background 11 dining table
1 aeroplane 12 dog
2 bicycle 13 horse
3 bird 14 motor bike
4 boad 15 person
5 bottle 16 potted plant
6 bus 17 sheep
7 car 18 sofa
8 cat 19 train
9 chair 20 tv/monitor
10 cow (255) (void)

Index Red Green Blue

0 ( 0 0 0 )
1 ( 128 0 0)
2 ( 0 128 0)
3 ( 128 128 0)
4 ( 0 0 128)
5 ( 128 0 128)
・

・
15 ( 192 128 128)
16 ( 0 64 0)
17 ( 128 64 0)
18 ( 0 192 0)
19 ( 128 192 0)
20 ( 0 64 128)

 

※インストール追加

>python -m pip install matplotlib

>pip install pillow

 

tf.nn.softmax_cross_entropy_with_logits_v2:

WARNING:tensorflow:From main.py:40: softmax_cross_entropy_with_logits (from tensorflow.python.ops.nn_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Future major versions of TensorFlow will allow gradients to flow
into the labels input on backprop by default.
$ python
from tensorflow.python.client import device_lib
device_lib.list_local_devices()
 
実際動いているところ

 ● Semantic_segmentation

 ● U-net

 

20181018

 

●Data Augmentation

   (Horizontal Flip、Vertical Flip、Random Crop、Scale Augmentation、Random Rotation、Cutout、Random Erasing)

●ImageNet ImageNetについて

●ResNet Deep Residual Learning for Image Recognition Kaiming He, et al 2015 12 10

FCN SegNet Dilated畳み込み DeepLab (v1 & v2) RefineNet PSPNet Large Kernel Matters DeepLab v3