SarahwXU / HiSup

MIT License
132 stars 20 forks source link

Custom training on my dataset #12

Open aymanaboghonim opened 1 year ago

aymanaboghonim commented 1 year ago

Thanks for this great works. I would like to know how to run training on my custom dataset ?? is there any guide for that ??

XJKunnn commented 1 year ago

Hi, thanks for your interest.

To train HiSup on custom dataset, you can try steps below:

Hope this helps.

aymanaboghonim commented 1 year ago

Thanks for your help. I will try .

aymanaboghonim commented 1 year ago

I could start training but how to fine tune your models on my dataset ?? my images is 512 * 512 , how to edit the config to match my images dim ? what about augmentation ?? image

aymanaboghonim commented 1 year ago

what about evaluation against val set after specific no of iterations or epoch ??

SarahwXU commented 1 year ago

The IMAGE in the configuration file states the input image. The TARGET states the size of feature map. The ORIGIN states the output results. Since your images are 512*512, you could follow the config-files/inria_hrnet48.yaml which also processes images of the same size.

The augmentation techniques are defined in the https://github.com/SarahwXU/HiSup/blob/69e0cb3c7039bd038139ae0b95ea4ef03b2e5162/hisup/dataset/build.py#L22

The training code does not include validation. If you need it, you could add the loop of validation to the function in https://github.com/SarahwXU/HiSup/blob/69e0cb3c7039bd038139ae0b95ea4ef03b2e5162/scripts/train.py#L72

aymanaboghonim commented 1 year ago

thanks alot. could you tell me how to run inference using my own custom model ?? which needed changes along using the final config.ymal file that is existed in the output dir of training ??

SarahwXU commented 1 year ago

For the testing, there are a few steps. Firstly, hope you add the name and path of testing file to the hisup/config/paths_catalog.py https://github.com/SarahwXU/HiSup/blob/69e0cb3c7039bd038139ae0b95ea4ef03b2e5162/hisup/config/paths_catalog.py#L9 Then you may need to assign the name of testing in the configuration file like this. https://github.com/SarahwXU/HiSup/blob/69e0cb3c7039bd038139ae0b95ea4ef03b2e5162/config-files/crowdai-small_hrnet48.yaml#L28 You also have to write the test function for your own dataset and add it here. https://github.com/SarahwXU/HiSup/blob/69e0cb3c7039bd038139ae0b95ea4ef03b2e5162/tools/test_pipelines.py#L93 If the size of testing images is not very large, you could follow the function named test_on_crowdai(). https://github.com/SarahwXU/HiSup/blob/69e0cb3c7039bd038139ae0b95ea4ef03b2e5162/tools/test_pipelines.py#L109 In short, it is highly suggested to follow the existing code for AICrowd or Inria dataset.

aymanaboghonim commented 1 year ago

thank you very much, I will follow your guidelines.

h-arslan commented 1 year ago

Hello, did you manage to train and make inference on custom data? I followed the steps you proposed @SarahwXU, I managed to get inference and visualize using pretrained models on my dataset. But after training on custom set, I could not get any polygon predictions. It only gives mask predictions and it results with error. Any idea about this? Thanks for the work you've done.

SarahwXU commented 1 year ago

I am afraid that I cannot offer help with such information. Maybe you want to give some details such as the results of mask prediction, junction prediction, the training log, or the error message.