This repository provides a script and recipe to train the RefineNet model on the COCO Dateset. The method belongs to paper RefineNet: Multi-Path Refinement Networks for High-Resolution Semantic Segmentation .
Copy from NVIDIA SSD pytorch
The following features are supported by this model.
Feature | RefineNet PyTorch |
---|---|
AMP | Yes |
DDP Multi GPU | Yes |
NVIDIA DALI | No |
AMP is an abbreviation used for automatic mixed precision training.
DDP stands for DistributedDataParallel and is used for multi-GPU training.
NVIDIA DALI - DALI is a library accelerating data preparation pipeline. To accelerate your input pipeline, you only need to define your data loader with the DALI library. For details, see example sources in this repo or see the DALI documentation
- Clone the repository.
git clone https://gitee.com/yann_qi/RefineNet-pytorch.git
or
git clone https://github.com/yannqi/RefineNet-pytorch.git
-
Download and preprocess the dataset.
The RefineNet model was trained on the COCO 2017 dataset. You can download the dataset on COCO Download.
NOTE: Make the dataset root like below:
└── COCO ├──images ├── train2017: All train images(118287 images) ├── val2017: All validate images(5000 images) ├── annotations ├── instances_train2017.json ├── instances_val2017.json ├── captions_train2017.json ├── captions_val2017.json ├── person_keypoints_train2017.json └── person_keypoints_val2017.json └── coco_labels.txt
-
Config Setting
Set the config in the
data/coco.yaml
-
Train the model.(Unnecessary, you can download the pretrained checkpoint.)
- Single GPU
sh scripts/single_gpu.sh
- Multi GPU
sh scripts/multi_gpu.sh
-
Evaluate the model on the COCO dataset.
Just run the
python test.py
Wait to update! Download from here: https://github.com/DrSleep/refinenet-pytorch/blob/master/models/resnet.py
According to this page, https://pytorch.org/hub/pytorch_vision_fcn_resnet101/, I find they train the model on the COCO dataset only on the 20 categories that are present in the Pascal VOC dataset. So I train the same categories.+
Model summary: 381 layers, 118052437 parameters, 118052437 gradients FLOPs: 263.097G Params: 118.052M FLOPs:263097106432.00, Params: 118052437.00
MIoU is: 0.714356010022485.
Checkpoint: Wait to update!
Wait to update!