plemeri / InSPyReNet

Official PyTorch implementation of Revisiting Image Pyramid Structure for High Resolution Salient Object Detection (ACCV 2022)
MIT License
500 stars 73 forks source link

train custom dataset #40

Closed crapthings closed 10 months ago

crapthings commented 11 months ago

Hello! After testing, removing the background has shown much better results compared to some other models. I would like to try training my own model.

This is a new field for me, and I have a few questions. Thank you!

  1. Can I continue from the latest.pth and fine-tune it? If so, when adding additional datasets, should I only keep the clothes and will the person be preserved when removing the background?

  2. When fine-tuning, should I include the training config YAML and the datasets mentioned in it?

  3. How should I prepare the dataset? I have looked at the folder structure of DIS5K, which seems to be as follows. Then I will put the data in and run train.py.

  4. How Many should i prepared? image and masked

res is about 1028 × 1828

DIS-TR
  im
  gt

DIS-VD
  im
  gt
image

configs/extra_dataset/Plus_Ultra.yaml

image
plemeri commented 11 months ago

Hi @crapthings, I saw your issue on our python API transparent-background. Thank you for selecting our work!

Here are the answers for your questions.

  1. You can use --resume argument for training script. Put the pre-trained checkpoint into the checkpoint_dir of your custom config file. If your task is masking the clothings only, then you need to train on your own dataset only. Do not include other datasets since they might include human masks.
  2. You may remove them and substitute with your own dataset's directory. The directory should follow the structure of the training datasets that we provide. root/sets/images for input images, root/sets/masks for binary ground truth masks.
  3. Just try our download script. https://github.com/plemeri/InSPyReNet/tree/main#easy-download-cake. You'll understand the structure.
  4. The more the better. our API is trained with massive composite dataset to achieve better performance. Try your best to get better results.

Thanks.

plemeri commented 10 months ago

Closing due to inactivity.