Convert human motion from video to .bvh with Google Colab
Note: This version is a fork from Dene33. I changed some parts of code to make the project work on Colab of Python 2.7 and tf 1.15
- Go to https://colab.research.google.com
File
>Upload notebook...
>GitHub
>Paste this link:
https://github.com/Dene33/video_to_bvh/blob/master/video_to_bvh.ipynb- Ensure that
Runtime
>Change runtime type
isPython 2!!!
withGPU
Second step is to install all the required dependencies. Select the first code cell and push shift+enter
. You'll see running lines of executing code. Wait until it's done (1-2 minutes).
- Select the code cell and push
shift+enter
- Push
select files
button - Select the video you want to process (it should contain only one person, all body parts in frame, long videos will take a lot of time to process. IMPORTANT: Make sure your video's name contains numbers only.)
- Specify desired
fps
rate at which you want to convert video to images. Lower fps = faster processing - Select the code cell and push
shift+enter
This step does all the job:
- Convertion of video to images (images are required for pose estimation to work)
- 2d pose estimation. For each image creates corresponding .json file with 2djoints with format similar to output .json format of original openpose. Fork of keras_Realtime_Multi-Person_Pose_Estimation is used.
- 3d pose estimation. Creates .csv file of all the frames of video with 3d joints coordinates. Fork of End-to-end Recovery of Human Shape and Pose
- Convertion of estimated .csv files to .bvh with help of custom script with .blend file.
- Select the code cell and push
shift+enter
.bvh will be saved to your PC. - If you want preview it, run Blender on your PC.
File
>Import
>Motion Capture (.bvh)
>alt+a
- Select the code cell and push
shift+enter
.