S-aiueo32 / contextual_loss_pytorch

Contextual Loss (CX) and Contextual Bilateral Loss (CoBi).
MIT License
172 stars 45 forks source link

about Contextual Bilateral Loss #2

Open qianzhang2018 opened 4 years ago

qianzhang2018 commented 4 years ago

Is the realizetion of Contextual Bilateral Loss based on "zoom learn zoom"? https://github.com/ceciliavision/zoom-learn-zoom

S-aiueo32 commented 4 years ago

Yes. It is mentioned in README. However, the status of CoBi is now WIP.

qianzhang2018 commented 4 years ago

Thank you for reply. So can it be used directly now?i want to use it in my own code.

qianzhang2018 commented 4 years ago

when i use the Contextual Loss,I find it easy for oom.But my batchsize is only one. the input of my x4 sr model is 128*128,can you give me some advise?

S-aiueo32 commented 4 years ago

This implementation is written on the basic mini-batching concept. In other words, all images or features in a mini-batch are allocated on GPU at the same time, which causes OOM. The original implementation computes distances for every single image or feature and then aggregates them. To avoid OOM, I should follow the original strategy by giving up the beauty of codes.

S-aiueo32 commented 4 years ago

Oh, I missed that your batch size is 1. It seems to be the other problem. Could you share the codes relevant to the loss computation?

conson0214 commented 4 years ago

when i training ESRGAN using Contextual Bilateral Loss, without l1/perceptual/GAN loss all the inference results seem to have artifacts like water ripple in smooth areas Do you have any idea how might this artifact come about?

1
S-aiueo32 commented 4 years ago

@conson0214 Please create a new issue for it