/FFA-Net

FFA-Net: Feature Fusion Attention Network for Single Image Dehazing

Primary LanguagePython

Official implementation.


by Xu Qin, Zhilin Wang et al. Peking University and Beijing University of Aeronautics & Astronautics.

Citation

To be determined.

Dependencies and Installation

  • python3
  • PyTorch>=1.0
  • NVIDIA GPU+CUDA
  • numpy
  • matplotlib

Datasets Preparation

Dataset website:RESIDE ; Paper arXiv version:[RESIDE: A Benchmark for Single Image Dehazing]

FILE STRUCTURE
    FFA-Net
    |-- README.md
    |-- net
    |-- data
        |-- RESIDEV0
            |-- ITS
                |-- hazy
                    |-- *.png
                |-- clear
                    |-- *.png
            |-- OTS 
                |-- hazy
                    |-- *.jpg
                |-- clear
                    |-- *.jpg
            |-- SOTS
                |-- indoor
                    |-- hazy
                        |-- *.png
                    |-- clear
                        |-- *.png
                |-- outdoor
                    |-- hazy
                        |-- *.jpg
                    |-- clear
                        |-- *.png

Usage

Train

Remove annotation from main.py if you want to use tensorboard or view intermediate predictions

If you have more computing resources, expanding bs, crop_size, gps, blocks will lead to better results

train network on ITS dataset

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

train network on OTS dataset

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

Test

Put your images in net/test_imgs/

python test.py

Samples