felixchenfy / Realtime-Action-Recognition

Apply ML to the skeletons from OpenPose; 9 actions; multiple people. (WARNING: I'm sorry that this is only good for course demo, not for real world applications !!! Those ary very difficult !!!)
MIT License
875 stars 256 forks source link

Train more than 9 actions #6

Closed 4al closed 5 years ago

4al commented 5 years ago

Hello and thank you for sharing your work with us! I've successfully managed to run the training with your dataset and the webcam demo, but I've encountered an error after training my own dataset with 19 different actions when running run_detector.py via webcam:

Realtime-Action-Recognition/src/mylib/action_classifier.py", line 85, in smooth_scores
score_sums += score
ValueError: operands could not be broadcast together with shapes (9,) (19,) (9,)

I've updated the action_labels in run_detector.py, but couldn't find any other declaration code for the number of action classes. I guess this might be a matrix dimension related problem. Could you help me with that?

hundanLi commented 5 years ago

You should change the action_labels in run_detector.py before running

python src/run_detector.py  --source txtscript 
felixchenfy commented 5 years ago

@4al Hi, did you solve the problem? The number of action classes is calculated from the names of the training data.

See src/train.ipynb: image

Then copy the labels to the variable action_labels in run_detector.py, and then the program should work.

Is it possible that your trained model is not saved to disk? Or you load the wrong model? Please message me if you solved it. Thanks!

4al commented 5 years ago

Thank you for the advice. That worked!