zhilin007 / FFA-Net

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remember to change the dataLoader before running

chocologic opened this issue · comments

我不知道是上传的代码版本有问题还是别的原因,但是DataLoader确实有问题,它没有返回hazy and gt, 而是hazy和正则化的hazy(名字为clear)。 这就是为什么指标很好,但是视觉上看没有效果的原因:因为dataloader的问题,模型拟合的目标一开始就是错的。
Error in class dataloader , it should return hazy image and clear image, but dataloader returns normalized hazy image and hazy image. This is why the metrics are good, but visually ineffective: because of the dataloader, the goal of the model fitting was wrong in the first place.

Code below looks normal but "clear" is actually hazy image.

clear_name = img    
clear = Image.open(os.path.join(self.clear_dir, clear_name))  

Advised Solution:

(__init__)
self.clear_imgs_dir = os.listdir(os.path.join(path, 'GT'))
self.clear_imgs = [os.path.join(path, 'GT', img) for img in self.clear_imgs_dir]                  
(__getitem__)
clear = Image.open(self.clear_imgs[index])