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.
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.
Expected Behavior
The custom loss function should receive the path or name of the images being processed.
The custom loss function should load the corresponding binary mask for each image.
The loss should be calculated only for the areas indicated by the binary mask.
Actual Behavior
I am unable to pass the image paths or names to the custom loss function.
As a result, I cannot load the corresponding binary masks to calculate the loss correctly.
Steps to Reproduce
Define a custom loss function that requires the image path to load a binary mask.
Attempt to integrate this loss function into the Real-ESRGAN training process.
Observe that the image paths are not accessible within the custom loss function.
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.