Giter Club home page Giter Club logo

Comments (6)

stevejbickley avatar stevejbickley commented on September 15, 2024

Hi Felixchenfy,

I was able to successfully train the model on different actions that I have recorded but have received a traceback error when I run 'run_detector'. It appears to only do this when attempting to classify the modified actions (i.e. it will run fine until I do the action at which point, I receive the error below).

For reference, I have trained the model on only two actions ('come here' and 'wave'). I have also attempted to run it when I have only trained it on one of those actions and received the same error. I am wondering if the program is designed to have exactly nine actions, in which case I would need to add more. As I understand it, the error is due to a mismatch in array size. Not sure how to fix, I would appreciate any guidance :)

Traceback (most recent call last):
File "C:\Users\steve\Documents\UNI\2019\S2\EGH400-2\code\working\Realtime-Action-Recognition-master\src\run_detector.py", line 316, in
dict_id2label = multipeople_classifier.classify(dict_id2skeleton)
File "C:\Users\steve\Documents\UNI\2019\S2\EGH400-2\code\working\Realtime-Action-Recognition-master\src\run_detector.py", line 258, in classify
id2label[id] = classifier.predict(skeleton) # predict label
File "C:\Users\steve\Documents\UNI\2019\S2\EGH400-2\code\working\Realtime-Action-Recognition-master\src\mylib\action_classifier.py", line 65, in predict
self.scores = self.smooth_scores(curr_scores)
File "C:\Users\steve\Documents\UNI\2019\S2\EGH400-2\code\working\Realtime-Action-Recognition-master\src\mylib\action_classifier.py", line 86, in smooth_scores
score_sums += score
ValueError: operands could not be broadcast together with shapes (9,) (2,) (9,)

from realtime-action-recognition.

felixchenfy avatar felixchenfy commented on September 15, 2024

@sbickley Hi, did you copy the action labels to the run_detector.py?

The detailed procedures are as follows:

When running src/train.ipynb, the function load_my_data should print out the action labels (computed from the names of training data):

62845392-732d2c00-bc95-11e9-9853-2ca49a3b76f3

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

from realtime-action-recognition.

stevejbickley avatar stevejbickley commented on September 15, 2024

That is exactly what the problem was!!! Thanks @felixchenfy :)

from realtime-action-recognition.

stevejbickley avatar stevejbickley commented on September 15, 2024

@felixchenfy just wondering if there was any particular reason you chose to use jupyter notebook for the training stage?

from realtime-action-recognition.

felixchenfy avatar felixchenfy commented on September 15, 2024

@sbickley No particular reason. It's just that jupyter is easy to debug.

from realtime-action-recognition.

felixchenfy avatar felixchenfy commented on September 15, 2024

@sbickley Hi, I just refactored the code to make it more readable, as well as making the API easier to use.

The training code is now in the .py instead of jupyter notebook.

The classes are now set in a configuration file config/config.yaml.

Just for your information. Thanks!

from realtime-action-recognition.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.