Giter Site home page Giter Site logo

sollan / alma Goto Github PK

View Code? Open in Web Editor NEW
13.0 3.0 5.0 12.26 MB

Fully automated (rodent) limb motion analysis toolbox for behavioral analysis with bodypart coordinate data, building upon markerless pose estimation.

License: GNU General Public License v3.0

Python 100.00%
gait-analysis pose-estimation behavior-analysis rodent-behaviors motion-tracking data-analysis computer-vision python opencv deeplabcut

alma's Introduction

Automated Limb Motion Analysis (ALMA)

Check out our paper:

Aljovic, A., Zhao, S., Chahin, M. et al. A deep learning-based toolbox for Automated Limb Motion Analysis (ALMA) in murine models of neurological disorders. Commun Biol 5, 131 (2022). https://doi.org/10.1038/s42003-022-03077-6

A behavioral data analysis toolbox for motor research in rodents.

To get started

The program has been tested on Windows, Mac, and Linux systems with Python 3.8, and should function even on low-end laptops. However, at least 8 GB RAM is recommended. Kinematic parameter extraction, particularly dynamic time warping, is computation-intensive and time-consuming, which will vary depending on your data size and hardware.

  1. Installation prerequisites: Python 3 (the dependency versions have been verified against Python 3.8 and 3.10, see details below), pip / (mini)conda (Miniconda documentation), (virtual environment / environment manager is recommended)
  2. Download / clone this repository to your computer.
  3. Open a terminal and navigate to the folder.
cd Downloads/alma
  1. Install dependencie in a Python 3.8 environment:
pip install -r requirements.txt

Alternatively, you can install in a Python 3.10 environment. The dependency list is provided for the Conda installer but can easily be adapted to use pip install instead:

conda env create -f conda_env_python_3_10.yml
conda activate venv_python_3_10
  1. Ready to go! (Check the command for the correct python version, which could be py, python3, python, ...)
python ./alma.py

Note that if using a Conda environment, you may need to run pythonw instead of python.

Troubleshoot

wxPython might not install at first if the gtk requirements are not met. If you see an error related to wxPython during pip install -r requirements.txt, try

pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk2/ubuntu-16.04/ wxPython

(https://wxpython.org/blog/2017-08-17-builds-for-linux-with-pip/index.html)

In some cases (particularly some Linux distributions), you might need to install some libraries such as libsdl or libpng12. This problem can be identified by errors when starting the app, such asImportError: libSDL2-2.0.so.0: cannot open shared object file: No such file or directory). Try to solve the ImportError accordingly, e.g.,

sudo apt-get install libsdl2-2.0

and,

sudo add-apt-repository ppa:linuxuprising/libpng12
sudo apt update
sudo apt install libpng12-0

If you run into problem installing, please open an issue with the details (error traces) and your system specs (operating system, python version, ...) on Github, and we will get back to you.

Adjusting the GUI display and experiment setups

Open the config.yaml file with a text editor. Here you'll find the parameters related to the interface display, as well as the default parameters for analyses. If the GUI window isn't displayed properly at first, you can adjust the window size by editting the window width / height values in config.yaml, saving, and restarting the program.

For more information or support, please visit our wiki page or contact us.

alma's People

Contributors

aljovic avatar dependabot[bot] avatar sollan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

alma's Issues

Program taking too long

I am currently attempting to analyze a few spontaneous mouse walking videos and have attached one of the DeepLabCut outputs. I have set the settings as shown below in the Python 3.10 environment. However, the ALMA program has been running for 2 days and I have yet to get any outputs. I was hoping you could help me and maybe give me a solution to run the program faster. Please let me know if you need anything else to help me!

image
image

Question

Dear developer,

Hi! I want to use the spontaneous walking function. I am considering that how can we label both left and right at a time. Since on our set, we could only view a side at a time when mice walk. As well, I want to know your body part definition. For example, how can you define the crest, knee, hip? Is there is any reference?

Sincerely,
Gary C. Lee

Allow user to calibrate x axis movement speed

Can be useful for treadmill speed calibration for pixel-wise speed in video.

E.g., select a period and calculate the average x axis location change; stack multiple periods together and calculate overall average.

Problem with preparing metadata

Hello,

I am trying to launch alma.py and have encountered an issue at the pip install -r requirements.txt step.
snip1

The error says that the metadata preparation did not run successfully.
snip2

I am using a Windows computer with Python3.10

Thanks,
Alex

Metadata-generation-failed

Hi,

Thank you for building this great toolbox! Unfortunately, I tried to install the requirements but I encounter with an error message: 'metadata-generation-failed'. I think it might be related to the numpy requirement. Could you help me with this?

Thanks!

Error installing -r requirements.txt

Hi there. I am trying to install and use the ALMA Toolbox for the first time. However there is a problem when installing the requirements. Below is the error code.

My operating system is macOS 12.5.1 and I am operating in Python 3.10 virtual environment. I have NumPy Version: 1.26.3.

Thanks for the help and looking forward to using the ALMA Toolbox.

Collecting numpy<=1.19,>=1.18.2 (from -r requirements.txt (line 3))
  Using cached numpy-1.19.0.zip (7.3 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [54 lines of output]
      Running from numpy source directory.
      <string>:460: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
      /private/var/folders/hg/mt9c8y8x289f12jsw8tz1q_40000gn/T/pip-install-gsf6za_8/numpy_1e9ba349238c43bc891e42abd0323d0b/tools/cythonize.py:73: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
        required_version = LooseVersion('0.29.14')
      /private/var/folders/hg/mt9c8y8x289f12jsw8tz1q_40000gn/T/pip-install-gsf6za_8/numpy_1e9ba349238c43bc891e42abd0323d0b/tools/cythonize.py:75: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
        if LooseVersion(cython_version) < required_version:
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
                  self.rng_state.ctr.v[i] = counter[i]
      
              self._reset_state_variables()
      
              self._bitgen.state = <void *>&self.rng_state
              self._bitgen.next_uint64 = &philox_uint64
                                         ^
      ------------------------------------------------------------
      
      _philox.pyx:195:35: Cannot assign type 'uint64_t (*)(void *) except? -1 nogil' to 'uint64_t (*)(void *) noexcept nogil'. Exception values are incompatible. Suggest adding 'noexcept' to the type of the value being assigned.
      Processing numpy/random/_bounded_integers.pxd.in
      Processing numpy/random/_philox.pyx
      Traceback (most recent call last):
        File "/private/var/folders/hg/mt9c8y8x289f12jsw8tz1q_40000gn/T/pip-install-gsf6za_8/numpy_1e9ba349238c43bc891e42abd0323d0b/tools/cythonize.py", line 235, in <module>
          main()
        File "/private/var/folders/hg/mt9c8y8x289f12jsw8tz1q_40000gn/T/pip-install-gsf6za_8/numpy_1e9ba349238c43bc891e42abd0323d0b/tools/cythonize.py", line 231, in main
          find_process_files(root_dir)
        File "/private/var/folders/hg/mt9c8y8x289f12jsw8tz1q_40000gn/T/pip-install-gsf6za_8/numpy_1e9ba349238c43bc891e42abd0323d0b/tools/cythonize.py", line 222, in find_process_files
          process(root_dir, fromfile, tofile, function, hash_db)
        File "/private/var/folders/hg/mt9c8y8x289f12jsw8tz1q_40000gn/T/pip-install-gsf6za_8/numpy_1e9ba349238c43bc891e42abd0323d0b/tools/cythonize.py", line 188, in process
          processor_function(fromfile, tofile)
        File "/private/var/folders/hg/mt9c8y8x289f12jsw8tz1q_40000gn/T/pip-install-gsf6za_8/numpy_1e9ba349238c43bc891e42abd0323d0b/tools/cythonize.py", line 77, in process_pyx
          subprocess.check_call(
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 369, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['/Library/Frameworks/Python.framework/Versions/3.10/bin/python3', '-m', 'cython', '-3', '--fast-fail', '-o', '_philox.c', '_philox.pyx']' returned non-zero exit status 1.
      Cythonizing sources
      Traceback (most recent call last):
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 149, in prepare_metadata_for_build_wheel
          return hook(metadata_directory, config_settings)
        File "/private/var/folders/hg/mt9c8y8x289f12jsw8tz1q_40000gn/T/pip-build-env-w3yve2iv/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 366, in prepare_metadata_for_build_wheel
          self.run_setup()
        File "/private/var/folders/hg/mt9c8y8x289f12jsw8tz1q_40000gn/T/pip-build-env-w3yve2iv/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 487, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/private/var/folders/hg/mt9c8y8x289f12jsw8tz1q_40000gn/T/pip-build-env-w3yve2iv/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 489, in <module>
        File "<string>", line 469, in setup_package
        File "<string>", line 274, in generate_cython
      RuntimeError: Running cythonize failed!
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.

How to extract the variables/parameters associated with each principal component?

In the paper, it Is mentioned that you could calculate the "factor loadings" (Fig. 2), or extract the "key parameters clustering with PC1" (Fig. 5). I was wondering if this function was included in the toolbox? If not, would it be possible if you could provide a brief tutorial on how one could approach this? I am grateful for this toolbox as it has allowed me to easier access to machine learning analysis techniques like PCA and Random forest classification, tools that I could not use before.

Alma. py is not starting

I'm installing alma in MAC OS 13.0.1

This is how is install alma

created my conda enviroment for alma

conda create --name alma python=3.8
#instalation of alma
pip install -r requirements.txt
it installed all the required packages.

trying to start alma it shows the following error.

python ./alma.py
Traceback (most recent call last):
File "./alma.py", line 2, in
from Panels import Start, AnalyzeStride, AnalyzeFootfall, RandomForest, PCA
File "/Users/manojkumark/Desktop/alma/Panels/RandomForest.py", line 3, in
from Functions import ConfigFunctions, DataAnalysisFunctions
File "/Users/manojkumark/Desktop/alma/Functions/DataAnalysisFunctions.py", line 5, in
from sklearn.ensemble import RandomForestClassifier
File "/Users/manojkumark/opt/anaconda3/envs/alma/lib/python3.8/site-packages/sklearn/ensemble/init.py", line 17, in
from ._gb import GradientBoostingClassifier
File "/Users/manojkumark/opt/anaconda3/envs/alma/lib/python3.8/site-packages/sklearn/ensemble/_gb.py", line 33, in
from ._gradient_boosting import predict_stages
File "init.pxd", line 918, in init sklearn.ensemble._gradient_boosting
RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C header, got 232 from PyObject

problem of python ./alma.py

Hi,
When I try to operate alma.py, it showed the error below. Do you know how to solve it? T\Are there any other information that I can provide for you to better understand this problem?
Thank you so much for your help in advance.

Best,
Alex

(DEEPLABCUT) C:\Users\90833\Downloads\alma-master>python ./alma.py
Traceback (most recent call last):
File "./alma.py", line 2, in
from Panels import Start, AnalyzeStride, AnalyzeFootfall, RandomForest, PCA
File "C:\Users\90833\Downloads\alma-master\Panels\RandomForest.py", line 3, in
from Functions import ConfigFunctions, DataAnalysisFunctions
File "C:\Users\90833\Downloads\alma-master\Functions\DataAnalysisFunctions.py", line 7, in
import seaborn as sns
File "C:\ProgramData\Anaconda3\envs\DEEPLABCUT\lib\site-packages\seaborn_init_.py", line 2, in
from .rcmod import * # noqa: F401,F403
File "C:\ProgramData\Anaconda3\envs\DEEPLABCUT\lib\site-packages\seaborn\rcmod.py", line 82, in
if LooseVersion(mpl.version) >= "3.0":
File "C:\ProgramData\Anaconda3\envs\DEEPLABCUT\lib\site-packages\setuptools_distutils\version.py", line 55, in init
warnings.warn(
DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.

Object has no attribute 'n_pred

Hi,
When i submit the data to lader run analysis. Im facing an error

"Traceback (most recent call last):
  File "/Users/manojkumark/Desktop/alma/Panels/AnalyzeFootfall.py", line 832, in DisplayFootfall_UI_2
    self.Footfall_UI_2()
  File "/Users/manojkumark/Desktop/alma/Panels/AnalyzeFootfall.py", line 598, in Footfall_UI_2
    if self.n_pred is not None:
AttributeError: 'AnalyzeFootfallPanel' object has no attribute 'n_pred'
"

I have included my input for the analysis
Screenshot 2023-01-06 at 09 31 05

Input data looks like this.
Screenshot 2023-01-06 at 09 29 41

Error message.

Screenshot 2023-01-06 at 09 31 15

python package with conflicting dependency

Hey Alma developers/users,

Here a conflicting dependency with the latest version of packages is found in win10 python 3.8 version.

The following two packages have to lower the version.
Matplotlib 3.6.2->3.5.3
Seaborn 0.12.3 -> 0.11.1

Happy Analyzing and Thanks for the development team:)
XQ

Alma.py is not launching up

Operting system - Ubuntu 20.04

Steps to do the installation.

With anaconda already installed:

conda create --name alma
conda activate alma
conda install -c conda-forge python=3.8.5
conda install -c conda-forge wxPython
git clone https://github.com/sollan/alma.git
cd alma
pip install -r requirements.txt

Started the program with python./alma.py

the below error pops up

Traceback (most recent call last):
  File "./alma.py", line 2, in <module>
    from Panels import Start, AnalyzeStride, AnalyzeFootfall, RandomForest, PCA
  File "/home/ivlab/Downloads/alma/Panels/RandomForest.py", line 3, in <module>
    from Functions import ConfigFunctions, DataAnalysisFunctions
  File "/home/ivlab/Downloads/alma/Functions/DataAnalysisFunctions.py", line 13, in <module>
    mpl.style.use('seaborn')
  File "/home/ivlab/miniconda3/envs/alma/lib/python3.8/site-packages/matplotlib/style/core.py", line 147, in use
    for style in map(fix_style, styles):
  File "/home/ivlab/miniconda3/envs/alma/lib/python3.8/site-packages/matplotlib/style/core.py", line 143, in fix_style
    _api.warn_deprecated("3.6", message=_DEPRECATED_SEABORN_MSG)
  File "/home/ivlab/miniconda3/envs/alma/lib/python3.8/site-packages/matplotlib/_api/deprecation.py", line 96, in warn_deprecated
    warn_external(warning, category=MatplotlibDeprecationWarning)
  File "/home/ivlab/miniconda3/envs/alma/lib/python3.8/site-packages/matplotlib/_api/__init__.py", line 363, in warn_external
    warnings.warn(message, category, stacklevel)
matplotlib._api.deprecation.MatplotlibDeprecationWarning: The seaborn styles shipped by Matplotlib are deprecated since 3.6, as they no longer correspond to the styles shipped by seaborn. However, they will remain available as 'seaborn-v0_8-<style>'. Alternatively, directly use the seaborn API instead.

numpy error

When I run ALMA, it has an issue with numpy. The numpy version is 1.22.4

image

numpy incompatibility with sklearn

@sollan

Hi, I am trying to install the alma package but I keep running into this error. We created an environment and tested different versions of NumPy with no success. Please advise, thanks in advance.

(alma) Michaels-MacBook-Air-3:alma-master michaelru$ python ./alma.py Traceback (most recent call last): File "./alma.py", line 2, in <module> from Panels import Start, AnalyzeStride, AnalyzeFootfall, RandomForest, PCA File "/Users/michaelru/Downloads/alma-master/Panels/RandomForest.py", line 3, in <module> from Functions import ConfigFunctions, DataAnalysisFunctions File "/Users/michaelru/Downloads/alma-master/Functions/DataAnalysisFunctions.py", line 5, in <module> from sklearn.ensemble import RandomForestClassifier File "/opt/anaconda3/envs/alma/lib/python3.8/site-packages/sklearn/ensemble/__init__.py", line 17, in <module> from ._gb import GradientBoostingClassifier File "/opt/anaconda3/envs/alma/lib/python3.8/site-packages/sklearn/ensemble/_gb.py", line 33, in <module> from ._gradient_boosting import predict_stages File "__init__.pxd", line 918, in init sklearn.ensemble._gradient_boosting RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject

AttributeError: 'NoneType' object has no attribute 'to_csv'

Trying to test the Spontaneous walking parameter extraction using the file I have attached.
E9_1_alma.csv

I have set the config file to the appropriate (1) frame_rate, (2) pixels_per_cm, and (3) right_to_left.
However, when I press "Start parameter extraction", I am getting the following error:

[69, 124, 182, 245, 304]
0     nan
1     nan
2     nan
3    2.32
4     nan
Name: cycle duration (s), dtype: object
Traceback (most recent call last):
  File "G:\Shared drives\Rodent Gait\alma\Panels\AnalyzeStride.py", line 704, in ExtractParameters
    KinematicsFunctions.make_parameters_output(self.output_path, parameters_truncated)                    
  File "G:\Shared drives\Rodent Gait\alma\Functions\KinematicsFunctions.py", line 201, in make_parameters_output
    parameters.to_csv(pathname)
AttributeError: 'NoneType' object has no attribute 'to_csv'

Could you help me with this issue?

KeyError: 'toe x' when importing csv in Treadmill

Hi,
I recorded and analyzed some data with deeplabcut from a mouse and I imported the CSV with the different markers (toe, mtp, ankle, knee, hip and iliac crest). Once I import the data into the Treadmill option and select Semi-automated, I get the following error:

Traceback (most recent call last):
  File "C:\Users\Name\anaconda3\envs\alma\lib\site-packages\pandas\core\indexes\base.py", line 3803, in get_loc
    return self._engine.get_loc(casted_key)
  File "pandas\_libs\index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
  File "pandas\_libs\index.pyx", line 165, in pandas._libs.index.IndexEngine.get_loc
  File "pandas\_libs\hashtable_class_helper.pxi", line 5745, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas\_libs\hashtable_class_helper.pxi", line 5753, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'toe x'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "C:\Users\Name\Desktop\alma\Panels\AnalyzeStride.py", line 449, in UpdateSpeed
    self.EstimateParams(self)
  File "C:\Users\Name\Desktop\alma\Panels\AnalyzeStride.py", line 481, in EstimateParams
    self.est_cm_speed, self.est_px_speed, self.est_pixels_per_cm, self.est_px_to_cm_speed_ratio = KinematicsFunctions.estimate_speed(self.df, 'toe', self.cm_speed, None, self.frame_rate, self.right_to_left)
  File "C:\Users\Name\Desktop\alma\Functions\KinematicsFunctions.py", line 59, in estimate_speed
    x_change = np.diff(pd_dataframe[f'{bodypart} x'][pd_dataframe[f'{bodypart} likelihood']>0.5])
  File "C:\Users\Name\anaconda3\envs\alma\lib\site-packages\pandas\core\frame.py", line 3804, in __getitem__
    indexer = self.columns.get_loc(key)
  File "C:\Users\Name\anaconda3\envs\alma\lib\site-packages\pandas\core\indexes\base.py", line 3805, in get_loc
    raise KeyError(key) from err
KeyError: 'toe x'

The goal is to extract the metrics of the gait.
Any help will be greately appreciate it.
Thanks,

Regarding issue with GAIT analysis

I have trained my mouse using DLC and extracted the data point for GAIT analysis.

while choosing the semi-automated methos im getting an error as shown below. I have also enclosed my video and the csv file provided by the DLC.

Traceback (most recent call last):
  File "/home/ivlab/miniconda3/envs/alma_new/lib/python3.8/site-packages/pandas/core/indexes/base.py", line 2646, in get_loc
    return self._engine.get_loc(key)
  File "pandas/_libs/index.pyx", line 111, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/hashtable_class_helper.pxi", line 1619, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas/_libs/hashtable_class_helper.pxi", line 1627, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'toe x'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ivlab/Downloads/alma-1.1.0/Panels/AnalyzeStride.py", line 441, in OnMethod
    self.EstimateParams(self)
  File "/home/ivlab/Downloads/alma-1.1.0/Panels/AnalyzeStride.py", line 481, in EstimateParams
    self.est_cm_speed, self.est_px_speed, self.est_pixels_per_cm, self.est_px_to_cm_speed_ratio = KinematicsFunctions.estimate_speed(self.df, 'toe', self.cm_speed, None, self.frame_rate, self.right_to_left)
  File "/home/ivlab/Downloads/alma-1.1.0/Functions/KinematicsFunctions.py", line 59, in estimate_speed
    x_change = np.diff(pd_dataframe[f'{bodypart} x'][pd_dataframe[f'{bodypart} likelihood']>0.5])
  File "/home/ivlab/miniconda3/envs/alma_new/lib/python3.8/site-packages/pandas/core/frame.py", line 2800, in __getitem__
    indexer = self.columns.get_loc(key)
  File "/home/ivlab/miniconda3/envs/alma_new/lib/python3.8/site-packages/pandas/core/indexes/base.py", line 2648, in get_loc
    return self._engine.get_loc(self._maybe_cast_indexer(key))
  File "pandas/_libs/index.pyx", line 111, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/hashtable_class_helper.pxi", line 1619, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas/_libs/hashtable_class_helper.pxi", line 1627, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'toe x'

TestDLC_resnet50_GAITMar23shuffle1_100000.csv

TestDLC_resnet50_GAITMar23shuffle1_100000_labeled.mp4

Errors and example dataset

Hello,

I've resolved the installation issues, but continue to have issue trying to use ALMA to do kinematic analysis. A recent error is below, and it is not clear if this is a version issue or something else.

I'm wondering if it is possible to see the 'pip freeze' output you used so I can just replicate my environment/version exactly. requirements.txt is a start, but there have still been some compatibility issues and deprecated functions as I try to use it.

Also, is it possible to include an example DLC file to import into the program to ensure my own DLC output is appropriate?

This looks like a great program and very useful, but I can't get it to work at all.

thanks!

The most recent error is:
Traceback (most recent call last):
File "./ALMAToolbox/alma/Panels/AnalyzeStride.py", line 697, in ExtractParameters
parameters, pd_dataframe_coords, is_stance, bodyparts = KinematicsFunctions.extract_parameters(self.frame_rate, self.df, self.cutoff_f, 'toe',
File "./ALMAToolbox/alma/Functions/KinematicsFunctions.py", line 803, in extract_parameters
return pd.DataFrame(data=np.array([
File "/opt/anaconda3/envs/alma/lib/python3.8/site-packages/pandas/core/frame.py", line 694, in init
mgr = ndarray_to_mgr(
File "
/opt/anaconda3/envs/alma/lib/python3.8/site-packages/pandas/core/internals/construction.py", line 351, in ndarray_to_mgr
_check_values_indices_shape_match(values, index, columns)
File "~/opt/anaconda3/envs/alma/lib/python3.8/site-packages/pandas/core/internals/construction.py", line 422, in _check_values_indices_shape_match
raise ValueError(f"Shape of passed values is {passed}, indices imply {implied}")
ValueError: Shape of passed values is (46, 1), indices imply (46, 46)

pca and rfc errors

Hi all,

I'm attempting to run my DLC outputs through ALMA for gait kinematics. Kinematic analysis successfully runs and provides the appropriate output. When attempting the further data analysis options, neither the random forest classifier nor the principal components analysis would successfully run. I received the same error for both RFC and PCA:

Traceback (most recent call last):
  File "C:\Users\ML\anaconda3\envs\alma_38\lib\site-packages\pandas\core\indexes\base.py", line 2646, in get_loc
    return self._engine.get_loc(key)
  File "pandas\_libs\index.pyx", line 111, in pandas._libs.index.IndexEngine.get_loc
  File "pandas\_libs\index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
  File "pandas\_libs\hashtable_class_helper.pxi", line 1619, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas\_libs\hashtable_class_helper.pxi", line 1627, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'cycle duration (no. frames)'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "E:\Kate\alma\alma\Panels\PCA.py", line 218, in PCA
    combined_df = DataAnalysisFunctions.combine_files(file_lists, group_names, self.output_path, 'average')
  File "E:\Kate\alma\alma\Functions\DataAnalysisFunctions.py", line 36, in combine_files
    df = df[df['cycle duration (no. frames)'] >= 0]
  File "C:\Users\ML\anaconda3\envs\alma_38\lib\site-packages\pandas\core\frame.py", line 2800, in __getitem__
    indexer = self.columns.get_loc(key)
  File "C:\Users\ML\anaconda3\envs\alma_38\lib\site-packages\pandas\core\indexes\base.py", line 2648, in get_loc
    return self._engine.get_loc(self._maybe_cast_indexer(key))
  File "pandas\_libs\index.pyx", line 111, in pandas._libs.index.IndexEngine.get_loc
  File "pandas\_libs\index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
  File "pandas\_libs\hashtable_class_helper.pxi", line 1619, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas\_libs\hashtable_class_helper.pxi", line 1627, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'cycle duration (no. frames)'

It seems like the error is related to the amount/quality of data I am trying to use (the videos used were a bit short and mice were poorly trained to walk on the treadmill). Can someone please explain why I am seeing this error? Why is ALMA capable of successfully extracting the kinematic parameters but no further analysis? Thank you!

issue launching alma.py

We are having trouble launching the alma.py file after successfully installing all of the prerequisites. Here is our error code below:

(almaenvironment) C:\Users\ Lab\Documents\ALMA\alma-master>python ./alma.py
Traceback (most recent call last):
File "./alma.py", line 2, in
from Panels import Start, AnalyzeStride, AnalyzeFootfall, RandomForest, PCA
File "C:\Users\ Lab\Documents\ALMA\alma-master\Panels\AnalyzeStride.py", line 2, in
from Functions import ConfigFunctions, KinematicsFunctions
File "C:\Users\ Lab\Documents\ALMA\alma-master\Functions\KinematicsFunctions.py", line 1, in
import pandas as pd
File "C:\Users\ Lab\Documents\ALMA\alma-master\almaenvironment\lib\site-packages\pandas_init_.py", line 50, in
from pandas.core.api import (
File "C:\Users\ Lab\Documents\ALMA\alma-master\almaenvironment\lib\site-packages\pandas\core\api.py", line 48, in
from pandas.core.groupby import (
File "C:\Users\ Lab\Documents\ALMA\alma-master\almaenvironment\lib\site-packages\pandas\core\groupby_init_.py", line 1, in
from pandas.core.groupby.generic import (
File "C:\Users\ Lab\Documents\ALMA\alma-master\almaenvironment\lib\site-packages\pandas\core\groupby\generic.py", line 73, in
from pandas.core.frame import DataFrame
File "C:\Users\ Lab\Documents\ALMA\alma-master\almaenvironment\lib\site-packages\pandas\core\frame.py", line 129, in
from pandas.core import (
File "C:\Users\ Lab\Documents\ALMA\alma-master\almaenvironment\lib\site-packages\pandas\core\generic.py", line 141, in
from pandas.core.window import (
File "C:\Users\ Lab\Documents\ALMA\alma-master\almaenvironment\lib\site-packages\pandas\core\window_init_.py", line 1, in
from pandas.core.window.ewm import ( # noqa:F401
File "C:\Users\ Lab\Documents\ALMA\alma-master\almaenvironment\lib\site-packages\pandas\core\window\ewm.py", line 11, in
import pandas._libs.window.aggregations as window_aggregations
ImportError: DLL load failed while importing aggregations: The specified module could not be found.

This is the code we run immediately before, to verify the prerequisites are installed:

(almaenvironment) C:\Users\ Lab\Documents\ALMA\alma-master>pip install -r requirements.txt
Requirement already satisfied: fastdtw>=0.3.4 in c:\users\ lab\documents\alma\alma-master\almaenvironment\lib\site-packages (from -r requirements.txt (line 1)) (0.3.4)
Requirement already satisfied: matplotlib>=3.2.1 in c:\users\ lab\documents\alma\alma-master\almaenvironment\lib\site-packages (from -r requirements.txt (line 2)) (3.4.2)
Requirement already satisfied: numpy>=1.18.2 in c:\users\ lab\documents\alma\alma-master\almaenvironment\lib\site-packages (from -r requirements.txt (line 3)) (1.21.1)
Requirement already satisfied: opencv-python==4.2.0.34 in c:\users\ lab\documents\alma\alma-master\almaenvironment\lib\site-packages (from -r requirements.txt (line 4)) (4.2.0.34)
Requirement already satisfied: pandas>=1.0.3 in c:\users\ lab\documents\alma\alma-master\almaenvironment\lib\site-packages (from -r requirements.txt (line 5)) (1.3.1)
Requirement already satisfied: PyYAML>=5.4 in c:\users\ lab\documents\alma\alma-master\almaenvironment\lib\site-packages (from -r requirements.txt (line 6)) (5.4.1)
Requirement already satisfied: scikit-learn==0.22.2.post1 in c:\users\ lab\documents\alma\alma-master\almaenvironment\lib\site-packages (from -r requirements.txt (line 7)) (0.22.2.post1)
Requirement already satisfied: scipy>=1.4.1 in c:\users\ lab\documents\alma\alma-master\almaenvironment\lib\site-packages (from -r requirements.txt (line 8)) (1.7.0)
Requirement already satisfied: seaborn>=0.10.0 in c:\users\ lab\documents\alma\alma-master\almaenvironment\lib\site-packages (from -r requirements.txt (line 9)) (0.11.1)
Requirement already satisfied: wxPython==4.1.0 in c:\users\ lab\documents\alma\alma-master\almaenvironment\lib\site-packages (from -r requirements.txt (line 10)) (4.1.0)
Requirement already satisfied: joblib>=0.11 in c:\users\ lab\documents\alma\alma-master\almaenvironment\lib\site-packages (from scikit-learn==0.22.2.post1->-r requirements.txt (line 7)) (1.0.1)
Requirement already satisfied: six in c:\users\ lab\documents\alma\alma-master\almaenvironment\lib\site-packages (from wxPython==4.1.0->-r requirements.txt (line 10)) (1.16.0)
Requirement already satisfied: pillow in c:\users\ lab\documents\alma\alma-master\almaenvironment\lib\site-packages (from wxPython==4.1.0->-r requirements.txt (line 10)) (8.3.1)
Requirement already satisfied: kiwisolver>=1.0.1 in c:\users\ lab\documents\alma\alma-master\almaenvironment\lib\site-packages (from matplotlib>=3.2.1->-r requirements.txt (line 2)) (1.3.1)
Requirement already satisfied: python-dateutil>=2.7 in c:\users\ lab\documents\alma\alma-master\almaenvironment\lib\site-packages (from matplotlib>=3.2.1->-r requirements.txt (line 2)) (2.8.2)
Requirement already satisfied: pyparsing>=2.2.1 in c:\users\ lab\documents\alma\alma-master\almaenvironment\lib\site-packages (from matplotlib>=3.2.1->-r requirements.txt (line 2)) (2.4.7)
Requirement already satisfied: cycler>=0.10 in c:\users\ lab\documents\alma\alma-master\almaenvironment\lib\site-packages (from matplotlib>=3.2.1->-r requirements.txt (line 2)) (0.10.0)
Requirement already satisfied: pytz>=2017.3 in c:\users\ lab\documents\alma\alma-master\almaenvironment\lib\site-packages (from pandas>=1.0.3->-r requirements.txt (line 5)) (2021.1)

We have attempted uninstalling and reinstalling pandas, since that is what the error seems to be referring to. The pandas version installed is >=1.0.3.

Cannot validate if first panel is set to be Kinematics

Traceback (most recent call last):
  File "slip_detector.py", line 175, in on_validate
    self.main_sizer.Replace(self.current_panel, self.ValidatePanel)
AttributeError: 'HomeFrame' object has no attribute 'ValidatePanel'

Installation error

Hi,
We installed Python 3.10 and Miniconda3 as instructed. We used the following code:
conda env create -f conda_env_python_3_10.yml
conda activate venv_python_3_10

Then we tried to run
pip install -r requirements.txt

We got the following error message:

Using cached numpy-1.19.0.zip (7.3 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [88 lines of output]
Running from numpy source directory.
:460: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
/private/var/folders/rs/6dqrcxv12lx9_jvf1gv1djw00000gn/T/pip-install-g0bcd_j9/numpy_582a062346a547efa0d6a2ad7910bb71/tools/cythonize.py:73: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
required_version = LooseVersion('0.29.14')
/private/var/folders/rs/6dqrcxv12lx9_jvf1gv1djw00000gn/T/pip-install-g0bcd_j9/numpy_582a062346a547efa0d6a2ad7910bb71/tools/cythonize.py:75: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
if LooseVersion(cython_version) < required_version:
performance hint: _common.pyx:275:19: Exception check after calling 'random_func' will always require the GIL to be acquired. Declare 'random_func' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
performance hint: _common.pyx:299:19: Exception check after calling 'random_func' will always require the GIL to be acquired. Declare 'random_func' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
performance hint: _common.pyx:322:50: Exception check after calling 'random_func' will always require the GIL to be acquired. Declare 'random_func' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
performance hint: _common.pyx:426:31: Exception check after calling 'f' will always require the GIL to be acquired. Declare 'f' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
performance hint: _common.pyx:465:31: Exception check after calling 'f' will always require the GIL to be acquired. Declare 'f' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
performance hint: _common.pyx:509:31: Exception check after calling 'f' will always require the GIL to be acquired. Declare 'f' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
performance hint: _common.pyx:592:36: Exception check after calling 'f0' will always require the GIL to be acquired. Declare 'f0' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
performance hint: _common.pyx:596:36: Exception check after calling 'f1' will always require the GIL to be acquired. Declare 'f1' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
performance hint: _common.pyx:600:36: Exception check after calling 'f2' will always require the GIL to be acquired. Declare 'f2' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
performance hint: _common.pyx:604:36: Exception check after calling 'f3' will always require the GIL to be acquired. Declare 'f3' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
performance hint: _common.pyx:638:31: Exception check after calling 'f' will always require the GIL to be acquired. Declare 'f' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
performance hint: _common.pyx:675:31: Exception check after calling 'f' will always require the GIL to be acquired. Declare 'f' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
performance hint: _common.pyx:712:63: Exception check after calling 'f' will always require the GIL to be acquired. Declare 'f' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
performance hint: _common.pyx:754:31: Exception check after calling 'f' will always require the GIL to be acquired. Declare 'f' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
performance hint: _common.pyx:785:31: Exception check after calling 'f' will always require the GIL to be acquired. Declare 'f' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
performance hint: _common.pyx:903:40: Exception check after calling 'f0' will always require the GIL to be acquired. Declare 'f0' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
performance hint: _common.pyx:907:40: Exception check after calling 'fd' will always require the GIL to be acquired. Declare 'fd' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
performance hint: _common.pyx:911:41: Exception check after calling 'fdd' will always require the GIL to be acquired. Declare 'fdd' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
performance hint: _common.pyx:916:40: Exception check after calling 'fi' will always require the GIL to be acquired. Declare 'fi' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
performance hint: _common.pyx:920:41: Exception check after calling 'fdi' will always require the GIL to be acquired. Declare 'fdi' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
performance hint: _common.pyx:924:38: Exception check after calling 'fiii' will always require the GIL to be acquired. Declare 'fiii' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
performance hint: _common.pyx:960:31: Exception check after calling 'f' will always require the GIL to be acquired. Declare 'f' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
performance hint: _common.pyx:1002:32: Exception check after calling 'f1' will always require the GIL to be acquired. Declare 'f1' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
performance hint: _generator.pyx:706:41: Exception check after calling '_shuffle_int' will always require the GIL to be acquired.
Possible solutions:
1. Declare '_shuffle_int' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
2. Use an 'int' return type on '_shuffle_int' to allow an error code to be returned.
performance hint: _generator.pyx:735:45: Exception check after calling '_shuffle_int' will always require the GIL to be acquired.
Possible solutions:
1. Declare '_shuffle_int' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
2. Use an 'int' return type on '_shuffle_int' to allow an error code to be returned.

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
          for i in range(1, RK_STATE_LEN):
              self.rng_state.key[i] = val[i]
          self.rng_state.pos = i
  
          self._bitgen.state = &self.rng_state
          self._bitgen.next_uint64 = &mt19937_uint64
                                     ^
  ------------------------------------------------------------
  
  _mt19937.pyx:138:35: Cannot assign type 'uint64_t (*)(void *) except? -1 nogil' to 'uint64_t (*)(void *) noexcept nogil'. Exception values are incompatible. Suggest adding 'noexcept' to the type of the value being assigned.
  Processing numpy/random/_bounded_integers.pxd.in
  Processing numpy/random/_bounded_integers.pyx.in
  Processing numpy/random/_common.pyx
  Processing numpy/random/_generator.pyx
  Processing numpy/random/_mt19937.pyx
  Traceback (most recent call last):
    File "/private/var/folders/rs/6dqrcxv12lx9_jvf1gv1djw00000gn/T/pip-install-g0bcd_j9/numpy_582a062346a547efa0d6a2ad7910bb71/tools/cythonize.py", line 235, in <module>
      main()
    File "/private/var/folders/rs/6dqrcxv12lx9_jvf1gv1djw00000gn/T/pip-install-g0bcd_j9/numpy_582a062346a547efa0d6a2ad7910bb71/tools/cythonize.py", line 231, in main
      find_process_files(root_dir)
    File "/private/var/folders/rs/6dqrcxv12lx9_jvf1gv1djw00000gn/T/pip-install-g0bcd_j9/numpy_582a062346a547efa0d6a2ad7910bb71/tools/cythonize.py", line 222, in find_process_files
      process(root_dir, fromfile, tofile, function, hash_db)
    File "/private/var/folders/rs/6dqrcxv12lx9_jvf1gv1djw00000gn/T/pip-install-g0bcd_j9/numpy_582a062346a547efa0d6a2ad7910bb71/tools/cythonize.py", line 188, in process
      processor_function(fromfile, tofile)
    File "/private/var/folders/rs/6dqrcxv12lx9_jvf1gv1djw00000gn/T/pip-install-g0bcd_j9/numpy_582a062346a547efa0d6a2ad7910bb71/tools/cythonize.py", line 77, in process_pyx
      subprocess.check_call(
    File "/Users/tedeschia/miniconda3/envs/venv_python_3_10/lib/python3.10/subprocess.py", line 369, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['/Users/tedeschia/miniconda3/envs/venv_python_3_10/bin/python3.10', '-m', 'cython', '-3', '--fast-fail', '-o', '_mt19937.c', '_mt19937.pyx']' returned non-zero exit status 1.
  Cythonizing sources
  Traceback (most recent call last):
    File "/Users/tedeschia/miniconda3/envs/venv_python_3_10/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
      main()
    File "/Users/tedeschia/miniconda3/envs/venv_python_3_10/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/Users/tedeschia/miniconda3/envs/venv_python_3_10/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 149, in prepare_metadata_for_build_wheel
      return hook(metadata_directory, config_settings)
    File "/private/var/folders/rs/6dqrcxv12lx9_jvf1gv1djw00000gn/T/pip-build-env-914leq5a/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 366, in prepare_metadata_for_build_wheel
      self.run_setup()
    File "/private/var/folders/rs/6dqrcxv12lx9_jvf1gv1djw00000gn/T/pip-build-env-914leq5a/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 487, in run_setup
      super().run_setup(setup_script=setup_script)
    File "/private/var/folders/rs/6dqrcxv12lx9_jvf1gv1djw00000gn/T/pip-build-env-914leq5a/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 311, in run_setup
      exec(code, locals())
    File "<string>", line 489, in <module>
    File "<string>", line 469, in setup_package
    File "<string>", line 274, in generate_cython
  RuntimeError: Running cythonize failed!
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.

Our mac operating system is macOS Sierra version 10.12.6 with 16 GB memory.

Any help will be greatly appreciated.

Thanks,

Issue while opening ALMA

I have trouble in installing the ALMA package.

when i try to open python alma.py I'm facing this error. i have also searched in the issue section, based on the sugesstion issue 25 . I have downgraded the Matplotlib 3.6.2->3.5.3 and Seaborn 0.12.3 -> 0.11.1
still the error pops up

Traceback (most recent call last):
File "alma.py", line 2, in
from Panels import Start, AnalyzeStride, AnalyzeFootfall, RandomForest, PCA
File "/home/venkateshlab/Downloads/alma/Panels/RandomForest.py", line 3, in
from Functions import ConfigFunctions, DataAnalysisFunctions
File "/home/venkateshlab/Downloads/alma/Functions/DataAnalysisFunctions.py", line 7, in
import seaborn as sns
File "/home/venkateshlab/miniconda3/envs/alma/lib/python3.8/site-packages/seaborn/init.py", line 2, in
from .rcmod import * # noqa: F401,F403
File "/home/venkateshlab/miniconda3/envs/alma/lib/python3.8/site-packages/seaborn/rcmod.py", line 82, in
if LooseVersion(mpl.version) >= "3.0":
File "/home/venkateshlab/miniconda3/envs/alma/lib/python3.8/site-packages/setuptools/_distutils/version.py", line 55, in init
warnings.warn(
DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.

How to adjust sensitivity on footfall analysis for deviation or threshold? Particularly with start/end time of footfall

Hi there

I am having issues with deviation being too sensitive, i.e there appears to be too many false positives for it to be useful out the box for automated footfall analysis. I note in the paper you guys mention adjusting the prominence peak detection threshold. It's a bit unclear how I should modify this (I'm assuming it's line 109 of FootfallFunctions.py?) as the prominence is (10, 100000) out of the box, but that doesn't appear to correspond to y axis numbers displayed on the validation image display which run from 0 at the top to 1000 at the bottom.

Basically when I compare my manual review with the automated deviation algo, I'm recording 11 footfalls manually, and it's picking up 34.

When I use threshold, it appears to do a much more accurate job, capturing 10/11. However, there is a more pressing concern, which is that the automated start and end points aren't particularly accurate. It will often set the start and end points at exactly the same position, or will record the start at the bottom of the slip trough or towards the end of the trough before recovery. Is there anything I could look to adjust here to improve accuracy without having to go through and manually adjust each footfall timing?

Regards
Jack

"Input vector should be 1-D"

While attempting to extract kinematic parameters using the extract_parameters function from KinematicsFunctions, I encountered a ValueError that says "Input vector should be 1-D".
I'm using Python 3.11.

  1. I loaded .csv file from DLC output for treadmill.
  2. I defined speed.
  3. When I click extract parameters I get a window pop up with the following error:

Traceback (most recent call last):
File "...AnalyzeStride.py", line 697, in ExtractParameters
parameters, pd_dataframe_coords, is_stance, bodyparts = KinematicsFunctions.extract_parameters(...)
File "...KinematicsFunctions.py", line 733, in extract_parameters
pairwise_dtw_res_x_5 = pairwise_dtw(toe_xs)
File "...KinematicsFunctions.py", line 194, in pairwise_dtw
distance, _ = fastdtw.fastdtw(iterable[i], iterable[j], dist=euclidean)
File "...site-packages\fastdtw\fastdtw.py", line 53, in fastdtw
return __fastdtw(x, y, radius, dist)
[Several recursive calls in fastdtw.py]
File "...site-packages\fastdtw\fastdtw.py", line 130, in dtw
return __dtw(x, y, None, dist)
File "...site-packages\fastdtw\fastdtw.py", line 141, in __dtw
dt = dist(x[i-1], y[j-1])
File "...site-packages\scipy\spatial\distance.py", line 536, in euclidean
return minkowski(u, v, p=2, w=w)
File "...site-packages\scipy\spatial\distance.py", line 479, in minkowski
u = _validate_vector(u)
File "...site-packages\scipy\spatial\distance.py", line 318, in _validate_vector
raise ValueError("Input vector should be 1-D.")
ValueError: Input vector should be 1-D.

The error originates from the euclidean distance function in scipy.spatial.distance. The euclidean function expects 1-D vectors as input. However, it seems that one or both of the vectors being passed to it are not 1-D. This might be due to the data being processed or perhaps the way the fastdtw function is handling the data.

Any guidance on how to resolve this issue would be greatly appreciated.

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.