XLearning-SCU / 2022-CVPR-AirNet

PyTorch implementation for All-In-One Image Restoration for Unknown Corruption (AirNet) (CVPR 2022)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Negative sample

dingyan1478 opened this issue · comments

I'm sorry to bother you, in the paper, you say that the negative sample is from different types of degenerate pictures, but this different degradation type refers to a different picture, or a different type (foggy and rainy), but why in the code, I feel that this negative sample is from the same picture?
image
image
image
What is the difference between degrad_patch_1 and degrad_patch_2
Looking forward to your apply!

Dingyan:
Thanks for your attention. degrad_patch_1 and degrad_patch_2 are different patches cropped from the same image.
In the implementation of MoCo, we input two sequences of patches whose shapes are both [batch_size, c, h, w]. In these two sequences of patches, patches with the same index (i.e., degrad_patch_1[0] and degrad_patch_2[0]) are considered as positive pairs, while patches with different index (i.e., degrad_patch_1[0] and degrad_patch_2[1]) are considered as negative pairs.
To construct tensors which meet above requirements, we crop different patches from the same image when "Dataset" is called and make the corruption types and levels different when Dataset" is called multiple times.
I hope it could be helpful for you. If you have any other questions, feel free to contact me.