XPixelGroup / BasicSR

Open Source Image and Video Restoration Toolbox for Super-resolution, Denoise, Deblurring, etc. Currently, it includes EDSR, RCAN, SRResNet, SRGAN, ESRGAN, EDVR, BasicVSR, SwinIR, ECBSR, etc. Also support StyleGAN2, DFDNet.
https://basicsr.readthedocs.io/en/latest/
Apache License 2.0
6.9k stars 1.2k forks source link

Custom Loss on Real-ESRGAN fine tune? #694

Open macunaimaa opened 4 months ago

macunaimaa commented 4 months ago

I am currently fine-tuning Real-ESRGAN and want to add a custom loss function that incorporates a semantic binary mask. The goal is to calculate the loss only in the regions where my model has classified the image, using the semantic mask as a binary indicator.

However, I am encountering difficulties in passing the paths or names of the images used in the training process to my custom loss function. This is essential for me to load the corresponding binary mask for each image.