Paper | ArXiv | Supp | Slides | Poster
TPSeNCE: Towards Artifact-Free Realistic Rain Generation for Deraining and Object Detection in Rain
Shen Zheng, Changjie Lu, Srinivasa Narasimhan
In WACV 2024
(12/20: WACV link is available)
(12/17: Update deraining instructions)
(11/28: Upload checkpoints for night and snowy.)
Rain Generation Video [here]
Object Detection Video [here]
git clone https://github.com/ShenZheng2000/TPSeNCE.git
pip install -r requirements.txt
Download training and testing images from [here]
Suppose we are translating clear images to rainy images, then we should put images under /path_to_your_dataset/ like this.
A: source images (e.g., clear images)
B: target images (e.g., rainy images)
S: sem. seg. maps of A
T: sem. seg. maps of B
/path_to_your_dataset/
├── trainA
├── trainB
├── trainS
├── trainT
├── testA
├── testB
├── testS
├── testT
testS and testT is not used for training or testing. However, make sure to include images in the testS and testT folders to prevent them from being empty, as an empty folder cause error during training and testing.
In convenience, we suggest that you use the following command to avoid empty folder.
cp -r testA testS
cp -r testB testT
As ground truth semantic segmentation maps are not available for BDD100K, we estimate these maps using the [ConvNeXt-XL] model from the [MMSegmentation] toolbox. If you are working with a dataset like [Cityscapes] which already includes ground truth semantic segmentation maps, the semantic guidance can be expected to be more effective.
Run in terminal.
bash train.sh
Download the checkpoints from [here]
Unzip the checkpoints.
Create folder bdd100k_1_20
, INIT
, and boreas_snowy
under ./checkpoints
like below.
/TPSeNCE/
├── checkpoints
│ ├── bdd100k_1_20 (clear2rainy)
│ ├── INIT (clear2rainy)
| ├── boreas_snowy (clearsnowy)
| ├── bdd100k_7_19_night_tri_sem (day2night)
| ├── bdd100k_7_20_snowy_tri_sem (clear2snowy)
bash test.sh
Choose one of the deraining methods below: (1)EffDerain (2)VRGNet (3)PreNet (4)SAPNet
Use TPSeNCE with checkpoint bdd100k_1_20
for testing (clear -> rainy)
Use deraining methods for training (rainy -> clear)
Extract Rainy_bad.zip
to obtain Rainy_bad
Perform inference on deraining methods for 100 heavy rain images inside Rainy_bad
, or any other real rainy images you prefer.
If you find this work helpful, please cite
@InProceedings{Zheng_2024_WACV,
author = {Zheng, Shen and Lu, Changjie and Narasimhan, Srinivasa G.},
title = {TPSeNCE: Towards Artifact-Free Realistic Rain Generation for Deraining and Object Detection in Rain},
booktitle = {Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision (WACV)},
month = {January},
year = {2024},
pages = {5394-5403}
}
This repository is heavily based upon [MoNCE] and [CUT].
This work is supported in part by General Motors.