GithubHelp home page GithubHelp logo

olafhaag / bvh-toolbox Goto Github PK

View Code? Open in Web Editor NEW
93.0 7.0 16.0 2.25 MB

Scripts for manipulating and converting BVH files.

License: MIT License

Python 100.00%
bvh-files animation converts-bvh panda3d cal3d skeleton-joints csv

bvh-toolbox's Introduction

Hi there ๐Ÿ‘‹

  • ๐Ÿ’ผ Iโ€™m currently working on Ready Player Me as a technical artist.
  • ๐Ÿง My experience is with developing tools, automation/pipeline, proceduralism, motion capture
  • ๐Ÿ“ซ How to reach me: LinkedIn, twitter, e-mail
  • ๐ŸŽจ My art stuff: artstation, deviantArt
  • โšก My further insterests are: Psychology (since I'm also a Dipl. Psychologist), Statistics, Machine Learning, Open Science

bvh-toolbox's People

Contributors

olafhaag avatar yanchxx 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  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

bvh-toolbox's Issues

No animation

I got some Position and rotation data from Azure Kinect. I have converted Azure Kinect Quaternion data to Euler angles and I have set up my hierarchy according to Microsoft documentation. However, after converting my position and orientation data to bvh, no motion is shown when I played the bvh file.

FIles are attached.
Windows OS
Motion type: T-pose
ex_hei.zip

Writing to/from csv truncates joint names

data = np.array(data, dtype=[('joint', np.unicode_, 20),

('parent', np.unicode_, 20),

limits the length of the joint names to 20, but in tests, you have joint names which are much longer, creating artifacts in the csvs such as:

mixamorig:LeftHandMi,mixamorig:LeftHandMi, 3.60930, -0.16690, 0.07780
mixamorig:LeftHandMi,mixamorig:LeftHandMi, 3.40040, -0.62740, 0.11480
mixamorig:LeftHandMi,mixamorig:LeftHandMi, 3.62050, -0.64930, 0.11990

Maybe adding an invertibility test (bvh -> csv -> bvh) would be of value? This could be part of #11

ModuleNotFoundError: No module named 'numpy'

How to actually use the bvh2csv (and csv2bvh) script? Trying to launch it, but getting the error of no module named 'numpy' Numpy installed, actually.

Should I install the bvh-toolbox first somehow? Also, getting error running setup.py - error in bvhtoolbox setup command: ('Duplicate entry point', 'console_scripts', 'bvh2egg')

Revisit rotation conversation to csv. It's way too slow!

The conversion is walking the BVH tree for each frame. But the file already has all the rotation values and it just needs to be filtered.

Maybe the values still need conversion because of rotation order or something else. Should check.
There's definitely much room for performance impovement.

CSV converter

Export rotations, and world position of joints to CSV files respectively.

bvh2csv throws error NotADirectoryError

Using up to date Archlinux
bvh2csv /home/olivier/Entry-1F.bvh --rotation --out /home/olivier Traceback (most recent call last): File "/usr/bin/bvh2csv", line 11, in <module> load_entry_point('bvhtoolbox==0.1.0', 'console_scripts', 'bvh2csv')() File "/usr/lib/python3.8/site-packages/bvhtoolbox/convert/bvh2csv_batch.py", line 107, in main os.chdir(src_folder_path) NotADirectoryError: [Errno 20] Not a directory: '/home/olivier/Entry-1F.bvh'

fix entry points/init imports

RuntimeWarning: 'bvhtoolbox.convert.bvh2csv' found in sys.modules after import of package 'bvhtoolbox.convert', but prior to execution of 'bvhtoolbox.convert.bvh2csv'; this may result in unpredictable behaviour
warn(RuntimeWarning(msg))

csv2bvh crash in reading hierarchy

ValueError: Changing the dtype to a subarray type is only supported if the total itemsize is unchanged

line 59, in get_hierarchy_data
offsets = rec_array[['offsetx', 'offsety', 'offsetz']].copy().view((float, 3))

Error in bvh_tree.write_file()

write() raise Error while it write _get_hierarchy_string(). The error is
IndexError: key CHANNELS not found
The error occur when it try to access the child with End Site, which should have no CHANNELS property.

csv2bvh does not work

Which tool (if any in particular)
I was using the csv2bvh tool. I am on MacOS. I am using Python 3.8.

Describe the bug
The bug causes this error:

  File "/usr/local/bin/csv2bvh", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bvhtoolbox/convert/csv2bvh.py", line 473, in main
    success = csv2bvh_file(hierarchy_src, position_src, rotation_src, dst_file_path)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bvhtoolbox/convert/csv2bvh.py", line 447, in csv2bvh_file
    data = csv2bvh_string(hierarchy_file, position_file, rotation_file, scale)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bvhtoolbox/convert/csv2bvh.py", line 360, in csv2bvh_string
    raise Exception("ERROR: No rotation data found for: {}".format(", ".join(missing_joint_data)))
Exception: ERROR: No rotation data found for: 

To Reproduce
Steps to reproduce the behavior:

  1. Run command
    csv2bvh hierarchy.csv position.csv rotation.csv

Expected behavior
The files convert into a BHV file

Additional context
Here are are the CSV files I am using:
https://drive.google.com/drive/folders/1lTKWIRG16m5JfHO52vjNKG1WYOvyFlFr?usp=sharing

bvhrenamejoints example?

Any possibility of adding an example or more documentation for renaming joints?

I see:

for row in csv_reader:
mapping[row[0]] = row[1]

But no matter what I'm getting: NameError: name 'mapping' is not defined.

Thank you!

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.