contextual_loss_pytorch icon indicating copy to clipboard operation
contextual_loss_pytorch copied to clipboard

about Contextual Bilateral Loss

Open qianzhang2018 opened this issue 5 years ago • 7 comments

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

qianzhang2018 avatar Dec 25 '19 03:12 qianzhang2018

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

S-aiueo32 avatar Dec 25 '19 03:12 S-aiueo32

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

qianzhang2018 avatar Dec 25 '19 04:12 qianzhang2018

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?

qianzhang2018 avatar Dec 25 '19 11:12 qianzhang2018

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 avatar Dec 25 '19 12:12 S-aiueo32

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?

S-aiueo32 avatar Dec 25 '19 12:12 S-aiueo32

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

conson0214 avatar Dec 26 '19 08:12 conson0214

@conson0214 Please create a new issue for it

S-aiueo32 avatar Dec 26 '19 13:12 S-aiueo32