advimman / lama

🦙 LaMa Image Inpainting, Resolution-robust Large Mask Inpainting with Fourier Convolutions, WACV 2022
https://advimman.github.io/lama-project/
Apache License 2.0
7.89k stars 835 forks source link

Dataset Dataloader to load the label image at the same time #215

Open lyu124 opened 1 year ago

lyu124 commented 1 year ago

Hi, i would like to use the network as backbone for segmentation. And i want to load the label image as well. So i wrote some lines as the image but i caught problem. The code can run for just 1 epoch, by the 2. epoch it shows error in image. Could you please give me some advice how i can solve it? Thank you so much. Screenshot from 2023-02-06 15-32-02

Screenshot from 2023-02-06 15-32-39

windj007 commented 1 year ago

The fact that the error occurs after a full epoch of training suggests me that the problem might be with the validation dataset. Does validation go well?

lyu124 commented 1 year ago

Hello, i think the problem occurs at train dataset, i have changed the train dataset loading according to /evaluation/data.py InpaintingDataset loadfile. The problem doesn't exit. Screenshot from 2023-02-13 14-34-35

Screenshot from 2023-02-13 14-35-14

I still got another question. In /saicipainting/evaluation/data.py, when we load image we have divide 255 for each data image and mask image. But for training, in /saicipainting/trainning/data/dataset.py, the images are not divided by 255. Why is it? Screenshot from 2023-02-13 14-31-03 Screenshot from 2023-02-13 14-31-27

Screenshot from 2023-02-13 14-32-20

When i load the label image by evaluating, do i also have to divide it by 255 ?