SysCV / sam-hq

Segment Anything in High Quality [NeurIPS 2023]
https://arxiv.org/abs/2306.01567
Apache License 2.0
3.65k stars 219 forks source link

About custom dataset. #55

Open willpat1213 opened 1 year ago

willpat1213 commented 1 year ago

There is a custom dataset, each picture contains multiple objects, how to modify the dataloader or model to train such a dataset?

ymq2017 commented 1 year ago

Hi, for a multi-object dataset, you could simply modify the dataloader to sample one mask each time randomly. Or you could load all masks and use them as prompts. Then we can change the prompt input to multi-mask, multi-box, multi-points. And the multi-mask output can be used to calculate loss with input multi GT mask. The latter requires a larger code change and would work better.

willpat1213 commented 1 year ago

Thanks for your reply! Another question is how do I design the loss in this case?

Rockwangyu commented 3 weeks ago

有一个自定义数据集,每张图片包含多个对象,如何修改 dataloader 或模型来训练这样的数据集?

hi, have you solved this problem? I also meet this problem but I do not how to modify the dataloader to to fit my own dataset