Fully Convolutional Networks is the first model to apply Convolutional Neural Network to semantic segmentation. It used common backbone like VGG, ResNet as encoder, and the decoders are upsampled layer by layer to original image size.
Model name | Dataset | MIoU | Pixel accuracy |
---|---|---|---|
FCN_8_Resnet50 | VOC train dataset | 0.4578 | 0.8993 |
VOC validation dataset | 0.751 | 0.9528 |
- Pull this repository.
git clone https://github.com/Runist/FCN-keras.git
- You need to install some dependency package.
cd FCN-keras
pip install -r requirements.txt
- Download the VOC dataset(VOC SegmetationClassAug if you need) .
- Getting FCN weights.
wget https://github.com/Runist/FCN-keras/releases/download/v0.2/fcn_weights.h5
- Run predict.py, you'll see the result of Fully Convolutional Networks.
python predict.py
Input image:
Output image(resize to 320 x 320):
- You should rewrite your data pipeline, Dateset where in dataset.py is the base class, such as VOCdataset.py.
class VOCDataset(Dataset):
def __init__(self, annotation_path, batch_size=4, target_size=(320, 320), num_classes=21, aug=False):
super().__init__(target_size, num_classes)
self.batch_size = batch_size
self.target_size = target_size
self.num_classes = num_classes
self.annotation_path = annotation_path
self.aug = aug
self.read_voc_annotation()
self.set_image_info()
- Start training.
python train.py
- Running evaluate.py to get mean iou and pixel accuracy.
python evaluate.py
--------------------------------------------------------------------------------
Total MIOU: 0.4578
Object MIOU: 0.4357
pixel acc: 0.8993
IOU: [0.89910368 0.57704284 0.42540458 0.37512895 0.20381801 0.35467035
0.77999658 0.63954053 0.6688376 0.22855226 0.36980252 0.25836402
0.59642955 0.48159056 0.42752974 0.67481864 0.13373938 0.33782181
0.30385944 0.47929764 0.39788109]