Giter Club home page Giter Club logo

Comments (6)

felixchenfy avatar felixchenfy commented on August 11, 2024

@ajuntapall Hi, the error is due to a NaN in the training data (the feature vectors).
Would you mind sending me the skeletons_info.txt generated from s2_*.py to my email [email protected] or putting it here? It will help me a lot for debugging.
Thank you very much!

from realtime-action-recognition.

lktinh2018 avatar lktinh2018 commented on August 11, 2024

Dear felixchenfy,

I have a same issue too.
F.Y.I

Best regards,
Tinh Lam
skeletons_info.txt

from realtime-action-recognition.

Salidor avatar Salidor commented on August 11, 2024

I have resolved the issue by replacing NaN:

def main():
    print("\nReading classes, features and labels ...")
    X = np.loadtxt(SRC_PROCESSED_FEATURES, dtype=float)  # features
    Y = np.loadtxt(SRC_PROCESSED_FEATURES_LABELS, dtype=int)  # labels
    col_mean = np.nanmean(X, axis=0)
    inds = np.where(np.isnan(X))
    X[inds] = np.take(col_mean, inds[1])

Idk if it's a proper solution but the recognition on test set works without a problem. Hope it helps.

from realtime-action-recognition.

felixchenfy avatar felixchenfy commented on August 11, 2024

@Salidor Hi, it looks like a good solution! Thank you so much!

I will test your code today and then update the repo.

@lktinh2018 Thanks for your data! I will use it to test the code today.

from realtime-action-recognition.

felixchenfy avatar felixchenfy commented on August 11, 2024

@Salidor @lktinh2018 Hi, I found the problem.
In utils/lib_feature_proc.py, I use the body height to normalize the skeleton. However, when the human is lying down, the height is zero, which causes the error.

So I changed the body height (y1-y2) to body length sqrt((x1-x2)**2 + (y1-y2)**2). The function after modification is shown below. The repo has been updated.

    @staticmethod
    def get_body_height(x):
        ''' Compute height of the body, which is defined as:
            the distance between `neck` and `thigh`.
        '''
        x0, y0 = get_joint(x, NECK)

        # Get average thigh height
        x11, y11 = get_joint(x, L_THIGH)
        x12, y12 = get_joint(x, R_THIGH)
        if y11 == NaN and y12 == NaN:  # Invalid data
            return 1.0
        if y11 == NaN:
            x1, y1 = x12, y12
        elif y12 == NaN:
            x1, y1 = x11, y11
        else:
            x1, y1 = (x11 + x12) / 2, (y11 + y12) / 2

        # Get body height
        height = ((x0-x1)**2 + (y0-y1)**2)**(0.5)
        return height

@lktinh2018 By the way, I tried your data, and the test accuracy is only 80% to 85%. And then I tested using my web camera, and the result is very poor..... Just for your information ...

from realtime-action-recognition.

DukeZacharia avatar DukeZacharia commented on August 11, 2024

@felixchenfy Hello, I know it has been for some time since you haven't worked on this project but I want to ask if is there anyone who has achieved the lying down activity using a webcam.

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.