cheny124800 / CIRKD

[CVPR-2022] Official implementations of CIRKD: Cross-Image Relational Knowledge Distillation for Semantic Segmentation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cross-Image Relational Knowledge Distillation for Semantic Segmentation

This repository contains the source code of CIRKD (Cross-Image Relational Knowledge Distillation for Semantic Segmentation).

Requirement

Ubuntu 18.04 LTS

Python 3.8 (Anaconda is recommended)

CUDA 11.1

PyTorch 1.8.0

NCCL for CUDA 11.1

Backbones pretrained on ImageNet:

Performance on Cityscapes

All models are trained over 8 * NVIDIA GeForce RTX 3090

Role Network Method Val mIoU test mIoU Pretrained train script
Teacher DeepLabV3-ResNet101 - 78.07 77.46 Google Drive sh
Student DeepLabV3-ResNet18 Baseline 74.21 73.45 - sh
Student DeepLabV3-ResNet18 CIRKD 76.38 75.05 Google Drive sh
Student DeepLabV3-ResNet18* Baseline 65.17 65.47 - sh
Student DeepLabV3-ResNet18* CIRKD 68.18 68.22 Google Drive sh
Student DeepLabV3-MobileNetV2 Baseline 73.12 72.36 - sh
Student DeepLabV3-MobileNetV2 CIRKD 75.42 74.03 Google Drive sh
Student PSPNet-ResNet18 Baseline 72.55 72.29 - sh
Student PSPNet-ResNet18 CIRKD 74.73 74.05 Google Drive sh

*denotes that we do not initialize the backbone with ImageNet pre-trained weights.

Evaluate pre-trained models on Cityscapes val and test sets

Evaluate the pre-trained models on val set

CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 \
  python -m torch.distributed.launch --nproc_per_node=8 eval.py \
  --model deeplabv3 \
  --backbone resnet101 \
  --data [your dataset path]/cityscapes/ \
  --save-dir [your directory path to store log files] \
  --pretrained [your checkpoint path]/deeplabv3_resnet101_citys_best_model.pth

Generate the resulting images on test set

CUDA_VISIBLE_DEVICES=0,1,2,3 \
  python -m torch.distributed.launch --nproc_per_node=4 test.py \
  --model deeplabv3 \
  --backbone resnet101 \
  --data [your dataset path]/cityscapes/ \
  --save-dir [your directory path to store resulting images] \
  --save-pred \
  --pretrained [your checkpoint path]/deeplabv3_resnet101_citys_best_model.pth

You can submit the resulting images to the Cityscapes test server.

The current codes have been reorganized and we have not tested them thoroughly. If you have any questions, please contact us without hesitation.

Citation

@inproceedings{yang2022cross,
  title={Cross-Image Relational Knowledge Distillation for Semantic Segmentation},
  author={Chuanguang Yang, Helong Zhou, Zhulin An, Xue Jiang, Yongjun Xu, Qian Zhang},
  booktitle={IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year={2022}
}

About

[CVPR-2022] Official implementations of CIRKD: Cross-Image Relational Knowledge Distillation for Semantic Segmentation


Languages

Language:Python 97.4%Language:Shell 2.6%