Here is the code for training and evaluation. Before that, you need to prepare data by downloading from the following link:
Dataset | Description | Download Link |
---|---|---|
MS COCO | 118k images with 1.2M instances (train) | official site |
COCO+LVIS* | 99k images with 1.5M instances (train) | original LVIS images + our combined annotations |
SBD | 8498 images with 20172 instances for (train) 2857 images with 6671 instances for (test) |
official site |
Grab Cut | 50 images with one object each (test) | GrabCut.zip (11 MB) |
Berkeley | 96 images with 100 instances (test) | Berkeley.zip (7 MB) |
DAVIS | 345 images with one object each (test) | DAVIS.zip (43 MB) |
Pascal VOC | 1449 images with 3417 instances (validation) | official site |
COCO_MVal | 800 images with 800 instances (test) | COCO_MVal.zip (127 MB) |
After downloading the data, please change the paths to the datasets in config.yml
.
- Train coarse level network
python train_coarse.py models/iter_mask/coarse_segformer_cocolvis_itermask_3p.py --workers 4 --exp-name segformer_coarse --gpus 0
- Train fine level network
python train_fine.py models/iter_mask/fine_segformer_cocolvis_itermask_3p.py --workers 4 --int-model segformer_corase --exp-name segformer_fine --gpus 0
python scripts/evaluate_model.py --intention ./experiments/iter_mask/resnet34/hrnet_coarse/checkpoints/last_checkpoint.pth --segmentation ./experiments/iter_mask/resnet34/hrnet_fine/checkpoints/last_checkpoint.pth --datasets GrabCut,Berkeley
Due to the double blind and file size limitation, we can't provide the pretrained checkpoint now. We will provide the pretrained checkpoint later.