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.
- Pull this repository.
git clone https://github.com/verages/Keras_RCN.git
- You need to install some dependency package.
cd FCN-keras
pip installl -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
- 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