HiSup icon indicating copy to clipboard operation
HiSup copied to clipboard

Custom training on my dataset

Open aymanaboghonim opened this issue 1 year ago • 10 comments

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

aymanaboghonim avatar Apr 09 '23 13:04 aymanaboghonim

Hi, thanks for your interest.

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

  • Prepare your dataset in COCO format
  • Add your dataset path in hisup/config/paths_catelog.py
  • Create your own config file and start training

Hope this helps.

XJKunnn avatar Apr 09 '23 13:04 XJKunnn

Thanks for your help. I will try .

aymanaboghonim avatar Apr 09 '23 14:04 aymanaboghonim

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 avatar Apr 09 '23 21:04 aymanaboghonim

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

aymanaboghonim avatar Apr 09 '23 21:04 aymanaboghonim

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

SarahwXU avatar Apr 14 '23 06:04 SarahwXU

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 ??

aymanaboghonim avatar Apr 14 '23 08:04 aymanaboghonim

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.

SarahwXU avatar Apr 20 '23 12:04 SarahwXU

thank you very much, I will follow your guidelines.

aymanaboghonim avatar Apr 25 '23 06:04 aymanaboghonim

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.

h-arslan avatar Aug 23 '23 13:08 h-arslan

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.

SarahwXU avatar Aug 29 '23 08:08 SarahwXU