Detectron.pytorch
Detectron.pytorch copied to clipboard
Training with a custom dataset
Can anyone suggest how can we train this model from scratch using a custom dataset other than COCO. Like how to prepare data and the steps involved in training?
Thanks
-
See how the city-scape dataset is converted to COCO JSON format from this example. I copied that setup and created my own dataset mirroring what is done for Cityscapes. This generates a JSON file, similar to the MS-COCO JSON, that can be used by Detectron.
-
Add your dataset to the dataset catalogue. The paths to image directory and JSON file of course will depend on the annotation conversion procedure in the earlier step.
-
Add this dataset in the net training script, otherwise you will get an "unknown dataset" error.
For Step 1, you may find this sample gist useful, where I converted face bounding boxes from the WIDER-dataset into the MS-COCO format.
@AruniRC now i want to fine tune on my own dataset,my object classes is 200,how can i complete this task?(1)transfor my dataset to the coco format,(2)Add your dataset to the dataset catalogue (3)Add this dataset in the net training script,but then should i change the last output network to 201 instead of 81? I have problem with this,how can i do?thx for your help!
@roytseng-tw if u have time to help me solve this ,i just want fine tune on my dataset of 200 classes , i am not clear of your codebase, if i want to retrain on my dataset, should i must change the code?and if so,where to change the code?appreciate it very much! thank u very much!
@AruniRC Hi I made the custom dataset like coco2017 ,but my dataset only have 2 classes , I changed the number of class in the net training script. But I don't know how to change the name of classes ,is the codes can get the classes name by my dataset's annotation?