This repository contains the source code of CVPR 2024 paper: "DuPL: Dual Student with Trustworthy Progressive Learning for Robust Weakly Supervised Semantic Segmentation".
The implementation is based on PyTorch 1.13.1 with single-node multi-gpu training. Please install the required packages by running:
pip install -r requirements.txt
# For Pascal VOC 2012
python -m torch.distributed.run --nproc_per_node=2 train_final_voc.py --data_folder [../VOC2012]
NOTE:
4
(num_gpus * sampler_per_gpu).--nproc_per_node
should be set according to your environment (recommend: 2x NVIDIA RTX 3090 GPUs).# For MSCOCO
python -m torch.distributed.run --nproc_per_node=4 train_final_coco.py --data_folder [../MSCOCO/coco2014]
NOTE:
8
(num_gpus * sampler_per_gpu).--nproc_per_node
should be set according to your environment (recommend: 4x NVIDIA RTX 3090 GPUs).pydensecrf
first:pip install git+https://github.com/lucasb-eyer/pydensecrf.git
NOTE: using pip install pydensecrf
will install an incompatible version ⚠️.
# For Pascal VOC
python eval_seg_voc.py --data_folder [../VOC2012] --model_path [path_to_model]
# For MSCOCO
python -m torch.distributed.launch --nproc_per_node=4 eval_seg_coco_ddp.py --data_folder [../MSCOCO/coco2014] --label_folder [../MSCOCO/SegmentationClass] --model_path [path_to_model]
NOTE:
ensemble
or model soup
, to further improve the performance (maybe).# modify the "dir" and "target_dir" before running
python convert_voc_rgb.py
python infer_cam_voc.py --data_folder [../VOC2012] --model_path [path_to_model]
NOTE: The CAM results will be saved at the checkpoint directory.
torch.distributed.launch
is available in your environment.MS COCO
, it may cost several hours for CRF post-processing.We have provided DuPL's pre-trained checkpoints on VOC and COCO datasets. With these checkpoints, it should be expected to reproduce the exact performance listed below.
Dataset | val | Log | Weights | val (with MS+CRF) | test (with MS+CRF) |
---|---|---|---|---|---|
VOC | 69.9 | log | weights | 72.2 | 71.6 |
VOC (21k) | -- | log | weights | 73.3 | 72.8 |
COCO | -- | log | weights | 43.5 | -- |
COCO (21k) | -- | log | weights | 44.6 | -- |
The VOC test results are evaluated on the official server, and the result links are provided in the paper.
We have provided the visualization of CAMs and segmentation images (RGB) on VOC 2012 (val
and test
) and MS COCO in the following links. Hope they can help you to easily compare with other works :)
Dataset | Link | Model |
---|---|---|
VOC - Validaion | dupl_voc_val.zip | DuPL (VOC test: 71.6) |
VOC - Test | dupl_voc_test.zip | DuPL (VOC test: 71.6) |
COCO - Validation | dupl_coco_val.zip | DuPL (COCO val: 43.5) |
Please kindly cite our paper if you find it's helpful in your work:
@inproceedings{wu2024dupl,
title={DuPL: Dual Student with Trustworthy Progressive Learning for Robust Weakly Supervised Semantic Segmentation},
author={Wu, Yuanchen and Ye, Xichen and Yang, Kequan and Li, Jide and Li, Xiaoqiang},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
pages={3534--3543},
year={2024}
}
We would like to thank all the researchers who open source their works to make this project possible, especially thanks to the authors of Toco for their brilliant work.