Giter Club home page Giter Club logo

c2pnet's Introduction

[CVPR 2023] Curricular Contrastive Regularization for Physics-aware Single Image Dehazing

PWC PWC

This is the official PyTorch codes for the paper:

Curricular Contrastive Regularization for Physics-aware Single Image Dehazing
Yu Zheng, Jiahui Zhan, Shengfeng He, Junyu Dong, Yong Du* ( * indicates corresponding author)
IEEE/CVF Conference on Computer Vision and Pattern Recognition

Network Architecture

Architecture

News

  • Apr 20, 2023: We release training code.

Getting started

Install

We test the code on PyTorch 1.10.1 + CUDA 11.4 .

  1. Create a new conda environment
conda create -n c2pnet python=3.7.11
conda activate c2pnet
  1. Install dependencies
pip install torch==1.10.0+cu111 torchvision==0.11.0+cu111 torchaudio==0.10.0 -f https://download.pytorch.org/whl/torch_stable.html
pip install -r requirements.txt

Training and Evaluation

Prepare dataset for evaluation

You can download the pretrained models and datasets on Google Drive(pretrained models and testset).

The final file path will be arranged as (please check it carefully):

|-trained_models
     |- ITS.pkl
     |- OTS.pkl
     └─ ... (model name)
|-data
     |-SOTS
        |- indoor
           |- hazy
              |- 1400_1.png 
              |- 1401_1.png 
              └─ ... (image name)
           |- clear
              |- 1400.png 
              |- 1401.png
              └─ ... (image name)
        |- outdoor
           |- hazy
              |- 0001_0.8_0.2.jpg 
              |- 0002_0.8_0.08.jpg
              └─ ... (image name)
           |- clear
              |- 0001.png 
              |- 0002.png
              └─ ... (image name)

Prepare dataset for train

Since our training dataset contains numerous negative samples, which has led to an oversized dataset, we have only uploaded the ITS training dataset on BaiduNetdisk. However, users can create additional datasets using the create_lmdb.py, where they can define the number of negative samples and the types of existing dehazers used.

The final file path will be arranged as (please check it carefully):

data
   |-ITS
      |- ITS.lmdb
   |- ...(dataset name)

Evaluation

Test C2PNet on SOTS-indoor dataset

python dehaze.py -d indoor

Test C2PNet on SOTS-outdoor dataset

python dehaze.py -d outdoor

See python dehaze.py -h for the list of optional arguments

Train

Train network on ITS dataset

python main.py --crop --crop_size=240 --blocks=19 --gps=3 --bs=2 --lr=0.0001 --trainset='its_train' --testset='its_test' --steps=1000000 --eval_step=5000 --clcrloss --clip

Train network on OTS dataset

python main.py --crop --crop_size=240 --blocks=19 --gps=3 --bs=2 --lr=0.0001 --trainset='ots_train' --testset='ots_test' --steps=1500000 --eval_step=5000 --clcrloss --clip

Citation

If you find our work useful for your research, please cite us:

@inproceedings{zheng2023curricular,
  title={Curricular Contrastive Regularization for Physics-aware Single Image Dehazing},
  author={Zheng, Yu and Zhan, Jiahui and He, Shengfeng and Dong, Junyu and Du, Yong},
  booktitle={IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year={2023}
}

c2pnet's People

Contributors

yuzheng9 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.