Skip to content

yannqi/RefineNet-pytorch

Repository files navigation

RefineNet For PyTorch (COCO Dataset)

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 .

Feature support matrix

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

Features

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

Usage

  1. Clone the repository.
git clone https://gitee.com/yann_qi/RefineNet-pytorch.git

or

git clone https://github.com/yannqi/RefineNet-pytorch.git

  1. 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
    
  2. Config Setting

    Set the config in the data/coco.yaml

  3. Train the model.(Unnecessary, you can download the pretrained checkpoint.)

    • Single GPU

    sh scripts/single_gpu.sh

    • Multi GPU

    sh scripts/multi_gpu.sh

  4. Evaluate the model on the COCO dataset.

    Just run the python test.py

Checkpoint Download

Wait to update! Download from here: https://github.com/DrSleep/refinenet-pytorch/blob/master/models/resnet.py

Results

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!

Data augmentation

Wait to update!

About

RefineNet by pytorch on COCO Dataset

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published