Skip to content
/ DCL Public

[AAAI 2025] Depth-Centric Dehazing and Depth-Estimation from Real-World Hazy Driving Video

License

Notifications You must be signed in to change notification settings

fanjunkai1/DCL

Repository files navigation

Depth-Centric Dehazing and Depth-Estimation from Real-World Hazy Driving Video (AAAI 2025)

Junkai Fan1Kun Wang1Zhiqiang Yan1Xiang Chen1  Shangbing Gao2Jun Li1Jian Yang1
1PCA Lab, Nanjing University of Science and Technology
2Huaiyin Institute of Technology

Paper Website License visitors

We propose a novel depth-centric learning (DCL) framework that integrates the atmospheric scattering model (ASM) with the brightness consistency constraint (BCC) constraint. Our key idea is that both ASM and BCC rely on a shared depth estimation network. This network simultaneously exploits adjacent dehazed frames to enhance depth estimation via BCC and uses the refined depth cues to more effectively remove haze through ASM.

example input output gif

For more video demos, please refer to our project homepage.

📢 News

  • [16-12-2024] The "Chinese Interpretation" version of DCL has been added.
  • [14-12-2024] Training and inference code is released. (this repository).
  • [13-12-2024] We created the project homepage and the GitHub README.
  • [10-12-2024] Accepted to AAA 2025.

DCL Pipeline

Our Depth-Centric Learning (DCL) framework integrates the atmospheric scattering model with a brightness consistency constraint via shared depth prediction. $D_{MFIR}$ improves high-frequency detail in dehazed frames, while $D_{MDR}$ reduces black holes in depth maps from weakly textured areas.

⚙️ Dependencies and Installation

Initialize Conda Environment and Clone Repo

git clone https://github.com/fanjunkai1/DCL.git

conda create -n DCL python=3.9.19
conda activate DCL

conda install pytorch==1.11.0 torchvision==0.12.0 torchaudio==0.11.0 cudatoolkit=11.3 -c pytorch

Intall Dependencies

pip install -r requirements.txt

Download and Preprocess dataset

The original DVD (CVPR 2024) dataset (1920x1080 size) can be downloaded from the following link:

  • GoProHazy dataset can be downloaded from Baidu Drive(hbih).
  • DrivingHazy dataset can be downloaded from Baidu Drive(ei4j).
  • InternetHazy dataset can be downloaded from Baidu Drive(p39a).

Google Drive users can download the GoProHazy, DrivingHazy, and InternetHazy datasets via this link

🚀 Preprocess dataset

All videos in these datasets are initially recorded at a resolution of 1920×1080. After applying distortion correction and cropping based on the intrinsic parameters K of the GoPro 11 camera (calibrated by us), the resolutions of GoProHazy and DrivingHazy are 1600×512.

  1. Camera Calibration. Download the chessboard image set from here, and place the data in the ./calibrate folder, then run the following command:
python calibrate.py
  1. Undistort and Crop. Use the calibration results to undistort and crop the 1920x1080 image to 1600x512, then save the new intrinsic parameters. The command is as follows:
python preprocess.py

The data organization for the ./preprocess folder is shown below:

preprocess
|--gopro_preprocess
   |--videos
      |--test
         |--clear_video
            |--...
         |--hazy_video
            |--...
         |--processed
            |--...
      |-- train
         |--clear_video
            |--1_clear_video.mp4
            |--...
         |--hazy_video
            |--1_hazy_video.mp4
            |--...
         |--processed
            |--clear_video
            |--hazy_video
            |--intrinsic.npy

Note: The preprocessed GoProHazy dataset can be downloaded here.

🏃 Data Split

The data format in the ./split/gopro_fan folder and the corresponding explanation are as follows:

......
train_video/hazy_video/7_hazy_video 6 5 4 5
train_video/hazy_video/7_hazy_video 7 5 5 6
train_video/hazy_video/7_hazy_video 8 6 5 7
......
the folder of current frame t t idx t matched idx t-1 matched idx t+1 matched idx
train_video/hazy_video/7_hazy_video 7 5 5 6

🏋️ Training DCL

  1. Training model. Place the gopro_data (preprocessed GoProHazy) folder, downloaded from Google Drive, into the ./data folder, and then execute the following command:
python train.py --model_name DCL
  1. Training Visualization. The training and validation log files for DCL are saved in the train and val folders under ./logger/DCL. They can be visualized in TensorBoard using the following command:
cd DCL
tensorboard --logdir=./logger/DCL

To visualize locally from a remote server, run ssh -L 16006:127.0.0.1:6006 -p xxxxx root@serverIP to set up the tunnel, then use the command above. Finally, open http://localhost:16006/ in your browser for training visualization.

⚡ Inference DCL on GoProHazy

Move the trained model from ./logger/DCL/models to the ./models/DCL folder, or use our pre-trained model, which can be downloaded from Google Drive. Then, execute the following command:

python test_gopro_hazy.py --image_path ./data/gopro_data/test_video/hazy_video/24_hazy_video

🎮 Inference DCL on DENSE-Fog

python test_dense_fog.py --image_path /opt/data/common/SeeingThroughFog/SeeingThroughFogCompressedExtracted --dataset densefog --load_weights_folder ./models/DCL
python test_dense_fog.py --image_path /opt/data/common/SeeingThroughFog/SeeingThroughFogCompressedExtracted --dataset lightfog --load_weights_folder ./models/DCL

The output test results are saved in the ./outputs folder.

🔍 Results

Our DCL achieved state-of-the-art performance on GoProHazy and DENSE-Fog datasets,

Visual Comparison (click to expand)
  • Visual comparison for video dehazing

  • Visual comparison for depth estimation

🎓 Citation

If you find the code helpful in your research or work, please cite the following paper(s).

@inproceedings{fan2025depth,
  title={Depth-Centric Dehazing and Depth-Estimation from Real-World Hazy Driving Video},
  author={Fan, Junkai and Wang, Kun and Yan, Zhiqiang and Chen, Xiang and Gao, Shangbing and Li, Jun and Yang, Jian},
  booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},
  pages={xxxxx--xxxxx},
  year={2025}
}

@inproceedings{fan2024driving,
  title={Driving-Video Dehazing with Non-Aligned Regularization for Safety Assistance},
  author={Fan, Junkai and Weng, Jiangwei and Wang, Kun and Yang, Yijun and Qian, Jianjun and Li, Jun and Yang, Jian},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  pages={26109--26119},
  year={2024}
}

🤗 Acknowledgment

This code is based on the Monodepth2 and DVD. Thank them for their outstanding work.

📧 Contact

If you have any questions or suggestions, please contact [email protected]

🎫 License

This work is licensed under the Apache License, Version 2.0 (as defined in the LICENSE).

By downloading and using the code and model you agree to the terms in the LICENSE.

License

About

[AAAI 2025] Depth-Centric Dehazing and Depth-Estimation from Real-World Hazy Driving Video

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages