akshaykadam771 / Suspicious-Activity-Detection-Using-Pose-Estimation

26 stars 10 forks source link

training a Classification Machine Learning model #2

Closed sushidelivery closed 3 years ago

sushidelivery commented 3 years ago

Thank you for a great project!

Can you share a step-by-step how did you train a Classification Machine learning model ? Which script did you run to train a classification model?

Now I have a custom dataset, and I have a json file for my data. Now I need to train a classification model for that.

Thanks in advance!

akshaykadam771 commented 3 years ago

Hi @guli333 , For training I had followed the same thing which we generally used to train any Machine Learning Classification model.I mean

1) First we get that dataset which we have transfromed from our json file.

2) Now did some analysis. i.e out of all features (in our case that will be x & y co-ordinate values from 17 keypoints) which are important for decision making.I mean how x & y co-ordinate values changes w.r.t our activities.

3) after that you can select any classification model.In my case I had used "Xgboost" ML model, because it was giving high accuracy as compared to other classification models.

4) Then after training, you just need to replace my model with your model.

5) If you need to change further in code, just use 2 files a) p_pose_nms.py b) writer.py

6) In p_pose_nms.py basically did the json file generation & activities prediction task.I kept my prediction code inside this file.

7) In Writer.py generally Skeleton generation on image and putting our results on image is happening.

8) So these are the only 2 files which we needs to focus on.

Currently I don't have that script which I had used for my training the model, but I will try to find out that one.once I will get that, I will share.

Please let me know if you have any doubts, Thanks