New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to train the model on Custom dataset? #55
Comments
For a custom dataset, you need the box label and id label. It is similar to the training strategy of MOT15 and MOT20. First you need to transform the custom dataset to the formation of our training data, like folder 'images' and 'labels with ids'. Then, you need to generate the label files. The code src/gen_labels_15.py may help you. Finally, you need to generate the paths of the training images like the files in src/data and add your json file for training in src/lib/cfg. Don't forget to change '--data_cfg' in the opts. Make sure all the steps are done and the custom dataset looks like our training data. You can train on your own dataset. I'm sorry the procedure is a little bit complex, but it will work if taking some time. |
Thank you so much @ifzhang . |
In the public mot dataset , "conf: this bbox contains the confidence degree of the object. It can be seen that it is not 0-1 in the traditional sense, and the higher the score is, the higher the confidence degree is."Or how do you make a custom data set? For example ,I want to track the car, How can I make the training datasets,how can I get the "conf "? thanks. |
Hi @ifzhang
|
|
@ifzhang Thank you so much! :) |
@ifzhang @PareshKamble
|
Hi @dongziqi001 I believe the error is caused due to passing of empty tensors to the loss function.
@ifzhang please correct me if I am wrong. |
Hi @PareshKamble , as you trained on the costom dataset, did you reproduce the results in the paper and i did not. The loss value was high up to 3.5 when finishd training and the batch size and epoch were 2 and 40. |
Hi @DonaldKam , I trained the FairMOT model on my custom dataset for 30 epochs with batch size of 4. However, the last loss value I got was 4.29. Though the model is performing well. I am going to train it again for more epochs when I have better computing power. Currently, working with single 2080 Ti GPU which took around 60 long hours to finish the training. |
@PareshKamble Looking forward to your good results. |
@alberto139 I use Intel's OpenVINO toolkits Computer Vision Annotation Tool. |
Thanks @PareshKamble! OpenVINO looks great! The README says that the data needs to be:
What exactly goes into each of those sub-folders? I downloaded some data from the MOTChallenge just to test it out and the file structure is quite different.
|
Dear @alberto139 As per my folder structure:
You may use this file for automatically filling up the MOT20->labels_with_ids with the object identities over frames. Finally, the labels_with_ids folder would be populated like below:
In case of your own dataset, you need to convert the gen_labels_20.py as per your requirements or use CVAT to do that for you. |
Thanks again for the help @PareshKamble !! |
Hello @ifzhang, thank you for your amazing work! What would be the best way to handle training on videos that contain many frames without any class detections? I saw you skipping label files for frames without detections in |
Hi @alekjedrosz |
Hi @alberto139, thank you for your help! I indeed did not realise this model performs tracking similarly to the two-step methods, hence temporal information does not need to be included. Did you, by any chance, manage to solve the input image resolution problem, when training on a custom dataset? I see |
@alekjedrosz I think you are correct in that all images get resized to (1088, 608). It doesn't really matter what the image sizes of the training set are, since they'll all be resized once they go into the model. I've tried changing the size of the image the model takes as input but I haven't been successful yet. Please let me know if you solve this. |
@alberto139 Thanks for your reply. You can change the input image size at train time in |
@alekjedrosz Thank you for the suggestion. I gave it a try but was unable to train with a different image size. I think this might have to do with the fact that I'm trying to fine-tune a model that excepts a different image size. I tired training with the following command: Let me know if your training process is different. |
if you set image_size to (h,w), and h/608 ==w/1088, it'll be fine. |
Thanks for the reply @GuHuangAI. For example I tried (304, 544), but get a similar error. UPDATE Got the answer from Zhongdao/Towards-Realtime-MOT#30 |
@alberto139 Thanks to your reply and you are right. |
@PareshKamble |
@geyu1998 what is the directory structure of yours?
How about yours? |
@PareshKamble |
@geyu1998 everything looks normal to me. |
@PareshKamble Thank you again for your response |
Hi, |
@geyu1998 IsADirectoryError: [Errno 21] Is a directory: '/FairMOT-master/datas/ |
Hello @ifzhang,
You did an impressive work on re-id.
The results are wonderful.
However, I could not see any option/code/method to train the model on a custom multiple person dataset.
May I know the procedure to train the model on such a custom dataset?
Thanking you in anticipation!
The text was updated successfully, but these errors were encountered: