[How to run through the defogging algorithm based on AOD-NET]

How to run through the defogging algorithm based on AOD-NET



Preface`

Source of paper:Insert image description here
Insert image description here

If you want to understand the principle of the algorithm, please read this article https://blog.csdn.net/Flag_ing/article/details/108923617


1. Environment configuration

window10 or window11 system
python3.7; pytorch0.4; use Anaconda to manage the programming environment;
python language programming software is pycharm

2. Resources

Paper address: https://arxiv.org/pdf/1707.06543.pdf

Related code: https://github.com/MayankSingal/PyTorch-Image-Dehazing

Data set download: https://sites.google.com/site/boyilics/website-builder/project-pag

————————————————

3. How to use the code

Get this file after downloading the code from github
Insert image description here

After unzipping it, the file contains these things
Insert image description here

Create a new folder unknown here and name it data
Insert image description here

Open data, create new data and images folders, and copy the images of the two data sets training images and original images downloaded from the original author's website into the data and images folders respectively. The original author's data set may need to be downloaded through the wall. If it cannot be downloaded, I can share it in the comment area, plus its code in GitHub.
Insert image description here

The two data sets are as follows:
Insert image description here

Insert image description here

Use pycharm to open the project file
Insert image description here


Parts of the code that need to be modified:
1. The code in line 27 of dataloader.py:

image = image.split("/")[-1]             

After change:

image = image.split("/")[-1][5:]      

2. The code in line 31 of dehaze.py:

torchvision.utils.save_image(torch.cat((data_hazy, clean_image),0), "results/" + image_path.split("/")[-1]) 

After change:

torchvision.utils.save_image(torch.cat((data_hazy, clean_image), 0), "results/" + image_path.split("/")[-1][5:])

After making the changes, you can run the code, and after about 10 cycles, the network model will be formed.

4. Operation

Run train.py to train the network
Insert image description here

Put the hazy image into test_images and run dehaze.py to test the dehazing effect.
Insert image description here

The dehazed pictures are placed in the result folder. The dehazed pictures are as follows:

Insert image description here
Insert image description here

Insert image description here

Insert image description here

Insert image description here


5. Note

When using codes and data sets, the original text, code and data set sources must be stated.

Guess you like

Origin blog.csdn.net/weixin_44208728/article/details/125480306