Giter VIP home page Giter VIP logo

opencap-processing's People

Contributors

antoinefalisse avatar carmichaelong avatar mattpetrucci avatar suhlrich avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

opencap-processing's Issues

Gait analysis

Failing with kids and not returning correct error:

No peaks are detected but code going through, crashing later.
image

To reproduce:
session_id = '16467055-c264-40e7-8a56-a3945ea2d729' # 1.25m/s
trial_name = 'kids19'

authentication

getpass doesn't work in spyder. Plus, figure out how to send 2fa, and potentially store credentials for the duration of the session, but reliably delete them once spyder is closed

Deg vs rad

Bug when coordinate files are provided in rad.

compiler issue

Seems like it is not picking the good compiler by default when installing Visual Studio 2022. Check if there is a way to identify the compiler on the computer and specify it in the cmake calls.

Manual fix:

  • Change this line to cmd1 = 'cmake "' + pathBuildExpressionGraph + '" -G "Visual Studio 17 2022" -A x64 -DTARGET_NAME:STRING="' + filename + '" -DSDK_DIR:PATH="' + SDK_DIR + '" -DCPP_DIR:PATH="' + CPP_DIR + '"'
  • Change this line to cmd3 = 'cmake "' + pathBuildExternalFunction + '" -G "Visual Studio 17 2022" -A x64 -DTARGET_NAME:STRING="' + filename + '" -DINSTALL_DIR:PATH="' + path_external_functions_filename_install + '"'

example.ipynb

Installing opensim, condacolab the sourcecode from github runs without problems on colab. I ran it directly and aslo made copy to an colab notebook version which gives me the same error.
image
image

I get following errors when importing packages
ModuleNotFoundError Traceback (most recent call last)
in
1 import os
----> 2 import utilsKinematics
3 from utils import download_kinematics
4 from utilsPlotting import plot_dataframe

/content/opencap-processing/utilsKinematics.py in
20
21 import os
---> 22 import opensim
23 import numpy as np
24 import pandas as pd

ModuleNotFoundError: No module named 'opensim'

image

Return gait events.

I suggest we add a function get_gait_events in the gait_analysis class that returns gaitEvents. That would be useful for downstream tasks.

Thoughts @suhlrich? I can do it.

Squat analysis

  • Segmentation: the algo assumes the end of a squat is the beginning of the next one. This isn't good if there are long pauses between reps, should identify beginning and end independently.
  • Single leg squat: identify leg of interest
    • Separate left/right leg metrics
    • Only calculate ipsilateral leg for single leg
  • Trunk lean wrt ground
  • Trunk lean wrt pelvis
  • KA if available
  • ankle eversion (check Matt DeMers study)
  • integrate into web app

Some squats for testing

Issues walking analysis

  1. HRNet is too confident, and when the person is half out of the field of view, it still gives good confidence to keypoints but the results are garbage, need to take that into account.
  2. For results to be meaningful over time, we should alway pick the same leg. Let's make this an optional flag that we can then use when deploying.

rect fem vast in

Check wrapping surface scaling thing.

Hard to get good fitting for this session.
ef516897-f0b2-493e-9927-3022db2d2ac3

Check if available before downloading again

A lot of the functions in utils will download / request even if it is already available locally.

For instance, download_trial will call get_model_and_metadata that will call get_neutral_trial_id that will call get_session_json. This makes the system not usable offline and can create bugs if the API is temporarily unavailable (happened to me overnight). It would be great if we had a consistent way of defining these functions. For each function would take an argument overwrite=False, such that by default it does not download again, but instead uses what is there already.

Thoughts @suhlrich ?

Download data- no module named 'decouple'

image

I get following issue while running the download data script no module named 'decouple'. Any tips how to resolved this? Has it something to do with the installating of !pip install python-decouple? There were no errors while installing packages.

kinetics

  • clean up code
  • example treadmill
  • example gait
  • example STS
  • example squats
  • example DJ
  • outputs
  • plotting
  • documentation
  • testing on Scott machine
  • testing on mac
  • testing on linux
  • authentication spyder
  • authentication pycharm
  • authentication terminal
  • option to write an env file
  • visual studio 2017, 2019, 2022 (looks like there is no need to specify compiler, to confirm but that's great)
  • deprecation warning
  • joint reaction analysis
  • treadmill vs non-treadmill is same session
  • bounds hip adds

@suhlrich feel free to add items

COM

Not a big fan that different filters are used for inputs and outputs. The OpenSim filter is a 3rd order I think

utilsKinetics

Add class utilsKinetics for analyzing kinetics results

get attribution error of foo

Hello, I keep getting the attribution error like the one below.

AttributeError: module 'foo' has no attribute 'foo'

It is coming from the generateF function in utilsOpenSimAD.py

def generateF(dim):
import foo
importlib.reload(foo)
cg = ca.CodeGenerator('foo_jac')
arg = ca.SX.sym('arg', dim)
y,, = foo.foo(arg)
F = ca.Function('F',[arg],[y])
cg.add(F)
cg.add(F.jacobian())
cg.generate()

How can I solve this problem?

I appreciate your answer in advance.

otp verification

Add otp verification step in utilsAuth in opencap-core and opencap-processing. If otp_verified is False, we can trigger the code to be sent just like we do for the front end, and have the user enter it into the terminal, and move on.

Bug gait analysis

Bug here, you cannot assign a NaN to an array of doubles. Need for fix + need for way to handle missing contralateral data in rest of code. Session for testing: 1a1e9c15-4bc3-4b72-bf9d-cc6ba9293c23, trial: 10mwt

CasADi 3.6

Test out new feature for bounds

optionssol.detect_simple_bounds = true; % (default = false)
opti.solver('ipopt',optionssol);
sol = opti.solve(); (edited)

step length in gait analysis

  1. Step length is calculating a norm from heel to heel instead of y position.
  2. gait frame is non orthogonal. replace with
        z_temp = np.zeros((self.nGaitCycles,3))
        for i in range(self.nGaitCycles):
            z_temp[i,:] = np.mean(asisVector[self.gaitEvents['ipsilateralIdx'][i,0]: \
                             self.gaitEvents['ipsilateralIdx'][i,2]],axis=0)
        z_temp = z_temp / np.linalg.norm(z_temp,axis=1,keepdims=True)
        ```

Dropjump analysis

  • Segmentation. Algo is clearly not robust (eg, assumes two peaks will be detected). While accuracy sure matters, I don't think any metric will be computed at a certain instant in time but rather max over contact period for instance. So it should not matter too much if we are slightly off. I used marker data for now, it seems a little off when comparing to the video/simulation so open to anything else. Also wasn't sure for now whether to use right vs left data for segmentation, or an average or the first in contact, or ... Open to suggestion.
  • Support single-leg
    • Segmentation
    • Identification
  • Add peak KA if available
  • Do we report both right and left separately for double leg dropjumps? An average? Peaks?
  • Trunk lean, I saw that you computed that differently, might be worth checking which method is best

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.