fenglinglwb / MAT

MAT: Mask-Aware Transformer for Large Hole Image Inpainting
Other
760 stars 85 forks source link

Using labels.json files for training on a custom dataset #56

Open Melissa3248 opened 1 year ago

Melissa3248 commented 1 year ago

Hello! Thank you for creating a great code repository for this method.

I'm training on a custom dataset from scratch, and I have 8 class labels for my images that I'd like to utilize during training. I've created two separate labels.json files: one for my training data folder, and another for my validation data folder. Each labels.json file contains a dictionary of the form: {'labels': dict}, where dict is another dictionary where the keys are the filenames in the current folder and the values are their respective labels. In both the train and validation data, I have 8 unique class labels (i.e., the same 8 label types for the training and validation data).

When I initiate training, the information output during model setup includes this line: "Label shape: [19]" I would expect the label shape to be 8 -- what do you expect is going wrong here? Am I storing the labels in an incorrect way, or am I misinterpreting this printed information?

Please let me know if there's anything I can clarify or double-check. Thank you in advance!

fenglinglwb commented 1 year ago

Sorry for the late reply. In our experiments, we didn't use the label information. From the information you provided, it seems that there may be something wrong with the data format or the logic of reading JSON files. We used the StyleGAN-ADA code base and the logic should be easy to modify. You could try to fix it.