AIST++ API This repo contains starter code for using the AIST++ dataset.

Overview

AIST++ API

This repo contains starter code for using the AIST++ dataset. To download the dataset or explore details of this dataset, please go to our dataset website.

Installation

The code has been tested on python>=3.7. You can install the dependencies and this repo by:

pip install -r requirements.txt
python setup.py install

You also need to make sure ffmpeg is installed on your machine, if you would like to visualize the annotations using this api.

How to use

We provide demo code for loading and visualizing AIST++ annotations. Note AIST++ annotations and videos, as well as the SMPL model (for SMPL visualization only) are required to run the demo code.

The directory structure of the data is expected to be:


├── motions/
├── keypoints2d/
├── keypoints3d/
├── splits/
├── cameras/
└── ignore_list.txt


└── *.mp4


├── SMPL_MALE.pkl
└── SMPL_FEMALE.pkl

Visualize 2D keypoints annotation

The command below will plot 2D keypoints onto the raw video and save it to the directory ./visualization/.

python demos/run_vis.py \
  --anno_dir <ANNOTATIONS_DIR> \
  --video_dir <VIDEO_DIR> \
  --save_dir ./visualization/ \
  --video_name gWA_sFM_c01_d27_mWA2_ch21 \
  --mode 2D

Visualize 3D keypoints annotation

The command below will project 3D keypoints onto the raw video using camera parameters, and save it to the directory ./visualization/.

python demos/run_vis.py \
  --anno_dir <ANNOTATIONS_DIR> \
  --video_dir <VIDEO_DIR> \
  --save_dir ./visualization/ \
  --video_name gWA_sFM_c01_d27_mWA2_ch21 \
  --mode 3D

Visualize the SMPL joints annotation

The command below will first calculate the SMPL joint locations from our motion annotations (joint rotations and root trajectories), then project them onto the raw video and plot. The result will be saved into the directory ./visualization/.

python demos/run_vis.py \
  --anno_dir <ANNOTATIONS_DIR> \
  --video_dir <VIDEO_DIR> \ 
  --smpl_dir <SMPL_DIR> \
  --save_dir ./visualization/ \ 
  --video_name gWA_sFM_c01_d27_mWA2_ch21 \ 
  --mode SMPL

Multi-view 3D keypoints and motion reconstruction

This repo also provides code we used for constructing this dataset from the multi-view AIST Dance Video Database. The construction pipeline starts with frame-by-frame 2D keypoint detection and manual camera estimation. Then triangulation and bundle adjustment are applied to optimize the camera parameters as well as the 3D keypoints. Finally we sequentially fit the SMPL model to 3D keypoints to get a motion sequence represented using joint angles and a root trajectory. The following figure shows our pipeline overview.

AIST++ construction pipeline overview.

The annotations in AIST++ are in COCO-format for 2D & 3D keypoints, and SMPL-format for human motion annotations. It is designed to serve general research purposes. However, in some cases you might need the data in different format (e.g., Openpose / Alphapose keypoints format, or STAR human motion format). With the code we provide, it should be easy to construct your own version of AIST++, with your own keypoint detector or human model definition.

Step 1. Assume you have your own 2D keypoint detection results stored in , you can start by preprocessing the keypoints into the .pkl format that we support. The code we used at this step is as follows but you might need to modify the script run_preprocessing.py in order to be compatible with your own data.

python processing/run_preprocessing.py \
  --keypoints_dir <KEYPOINTS_DIR> \
  --save_dir <ANNOTATIONS_DIR>/keypoints2d/

Step 2. Then you can estimate the camera parameters using your 2D keypoints. This step is optional as you can still use our camera parameter estimates which are quite accurate. At this step, you will need the /cameras/mapping.txt file which stores the mapping from videos to different environment settings.

# If you would like to estimate your own camera parameters:
python processing/run_estimate_camera.py \
  --anno_dir <ANNOTATIONS_DIR> \
  --save_dir <ANNOTATIONS_DIR>/cameras/
# Or you can skip this step by just using our camera parameter estimates.

Step 3. Next step is to perform 3D keypoints reconstruction from multi-view 2D keypoints and camera parameters. You can just run:

python processing/run_estimate_keypoints.py \
  --anno_dir <ANNOTATIONS_DIR> \
  --save_dir <ANNOTATIONS_DIR>/keypoints3d/

Step 4. Finally we can estimate SMPL-format human motion data by fitting the 3D keypoints to the SMPL model. If you would like to use another human model such as STAR, you will need to do some modifications in the script run_estimate_smpl.py. The following command runs SMPL fitting.

python processing/run_estimate_smpl.py \
  --anno_dir <ANNOTATIONS_DIR> \
  --smpl_dir <SMPL_DIR> \
  --save_dir <ANNOTATIONS_DIR>/motions/

Note that this step will take several days to process the entire dataset if your machine has only one GPU. In practise, we run this step on a cluster, but are only able to provide the single-threaded version.

MISC.

  • COCO-format keypoint definition:
[
"nose", 
"left_eye", "right_eye", "left_ear", "right_ear", "left_shoulder","right_shoulder", 
"left_elbow", "right_elbow", "left_wrist", "right_wrist", "left_hip", "right_hip", 
"left_knee", "right_knee", "left_ankle", "right_ankle"
]
  • SMPL-format body joint definition:
[
"root", 
"left_hip", "left_knee", "left_foot", "left_toe", 
"right_hip", "right_knee", "right_foot", "right_toe",
"waist", "spine", "chest", "neck", "head", 
"left_in_shoulder", "left_shoulder", "left_elbow", "left_wrist",
"right_in_shoulder", "right_shoulder", "right_elbow", "right_wrist"
]
Comments
  • Questions about Transformer Network and Model Training

    Questions about Transformer Network and Model Training

    Hi, @liruilong940607 I have some questions about the input and output of transformer network. image

    1. As the paper said, during training, the input of the Audio Transformer is music feature Y with shape (240, 35) and the input of Motion Transformer is motion data X with shape (120, 219) , so for all of Q,K,V are same, include the query vector of decoder of these transformer. Is this right?
    2. For the cross-modal transformer, assume I get H(X) (240, 512) and H(Y) (120, 512) after audio and motion transformer, how to fuse features from music and motion features? Just concatenate both in sequence dimension resulting in features with shape (240 + 120, 512)?
    3. What's the query vector of cross-modal transformer decoder? How to get a motion output with 20 frames?
    4. What is the representation of motion prediction? Is it same as the input motion data with 24*3*3 + 3 = 219. But I think it is not good to regress a 3x3 rotation matrix directly? And for the regression of global translation, do you directly regress the absolute translation (x,y,z) in 3D space? Or just the offset relative to the first frame of seed motion? Thanks!
    opened by zhixinwang 14
  • Convention joint axis for SMPL pose visualisation

    Convention joint axis for SMPL pose visualisation

    Hi there! Hope you are well! :)

    I am desperately trying to visualize the SMPL pose parameters from your dataset but it seems that your axis convention does not meet mine.

    I have got inverted and inconsistent rotations as in the following picture : image

    I have tried to swap (x, y z) axis, oppose signs in the x, y or z direction without success.

    Do you have any idea of the transformation I need to make to visualize the animation properly ? Could you please provide the axis convention used for your skeleton please ?

    Thank you :D

    opened by antoinedelplace 7
  • Camera Trasnslation is not correct

    Camera Trasnslation is not correct

    I am trying to project the keypoints viewed from the Camera of (0,0,0) exactly as the image through the world_to_camera method and additional methods. For example:

    image

    In above image, assuming that the camera was shot at (0,0,0) in the current 3d space, I would like to match the rotation and translation of the keypoints as shown in the photo above. (The photo above was adjusted manually and was not correct. Also, don't mind scattered points of any color other than the human keypoint below)

    image However, when the camera translations of the annotations are displayed in 3d space, they appear as follows compared to other keypoints. You can see that the height does not match with the human keypoints, and it is not surrounded by 360 degrees and is clustered in a specific area.

    Looking at it a little further, it looks like this: image

    I think the coordinate scale of camera translation and human keypoints translation is different or there are other reasons. If what I didn't aware about something can you explain?

    Thank you very much for providing the dataset.

    opened by Realdr4g0n 6
  • Question about visualizing the SMPL joints

    Question about visualizing the SMPL joints

    Hi,

    Your work is excellent and I am interested in it! Now I'm trying my hands on visualizing the SMPL joints.

    But I have no idea about where the file "SMPL_MALE.pkl" is and what function it serves as. Could you please tell me about it?

    Sincerely, Shuhong

    opened by zsh2000 5
  • About SMPL shape parameters

    About SMPL shape parameters

    Hi, thanks for your amazing dataset! I found this dataset does not contain the shape parameters of SMPL model. Also, the learning rate is set to 0 for all stages. Also, shape parameters will affect the scale optimization. So, which shape parameters should I use for visualizing the SMPL mesh?

    opened by tszhang97 5
  • Trouble downloading the dataset

    Trouble downloading the dataset

    Hi,

    Thanks for your. wonderful datasets.

    I recently do some thing about 3D humane pose and I tried to download your dataset. However I always meet the error 'multiprocessing.pool.MaybeEncodingError: Error sending result: '<multiprocessing.pool.ExceptionWithTraceback object at 0x7f344db94160>'. Reason: 'TypeError("cannot serialize '_io.BufferedReader' object",)'.

    Thus I am not sure whether I have finished the downloading. I find a video file list in downloader.py, so I download it individually. I find the video_list contains 12669 items, but it not equal to the annotations which only contains 1408 SMPL files.

    I wonder how to check the dataset? One more thing, how can I fixed the error when I using?

    Looking forward to hearing from you,

    opened by AmberCheng 5
  • FPS

    FPS

    I Downloaded the Keypoints 3D only and it says "all annotations are 60 fps", however when i open them they seems to be 30fps for example a motion of duration : 1 minute and 35 seconds is around 2800 frames not 5600 is it right ? should i treat the keypoints3d as 30fps.

    Plus: if it is so and i want to extract audio_features with the same fps from audio, is it right to use a sample rate = 48000and hope_size = 800 ?

    opened by cassanelligiovanni 4
  • Visualization SMPL

    Visualization SMPL

    Hi, Thanks a lot for releasing this dataset. You are providing visualization of keypoints, that's great. However you are not providing a way to visualize SMPL from each camera view point, would it be possible to incorporate this in the run_vis.py file? For the moment the SMPL poses is independant to camera viewpoints, how to you make it dependant from a specific camera viewpoint? Thanks a lot for your help. Fabien

    opened by fabienbaradel 4
  • can't find SMPL download link

    can't find SMPL download link

    I can't find the download button of SMPL model on the download page of https://smpl.is.tue.mpg.de/downloads.

    Is the download button of SMPL model has been cancelled?

    Thanks!

    opened by ismeyueyue 3
  • Audio fragments extraction/alignment

    Audio fragments extraction/alignment

    Hi, Is it possible to post a script that aligned the music and motion recordings? As I can see, in the AIST dataset the audio fragments do not match the length of the corresponding fragments, and when extracting audio directly from a video fragment it is not clear how to properly align the individual features of the audio and movement frames.

    Timur Sokhin

    opened by Qwinpin 2
  • Where could I find the filter list of aistplusplus

    Where could I find the filter list of aistplusplus

    Hi,thanks for sharing such a great dataset. I have downloaded the dataset but failed to find the ignore_list.txt which is mentioned in AIST++ websites ?

    opened by icech 2
  • Trouble about the 3D joint rot data

    Trouble about the 3D joint rot data

    We noticed that your paper stated that the dataset contained 3D joint rot data, but we cannot find it on the web page. So I was wondering if there are any accesses to download the 3D joint rot data. We hope to do some research with this data.
    I look forward to hearing from you.

    opened by tychey 0
  • Incorrect Visualization Results (using SMPL)

    Incorrect Visualization Results (using SMPL)

    I'm very interested in this dataset so I did some experiments with SMPL backbone. But the result turns out quite surprising, so I further analyzed the dataset. My approach is to use run_vis.py to re-run unreasonable videos on my model. And here are my results:

    • gBR_sFM_c09_d04_mBR4_ch07

    with the setting

    flags.DEFINE_string(
        'video_name',
        'gBR_sFM_c09_d04_mBR4_ch07',
        'input video name to be visualized.')
    flags.DEFINE_enum(
        'mode', 'SMPL', ['2D', '3D', 'SMPL', 'SMPLMesh'],
        'visualize 3D or 2D keypoints, or SMPL joints on image plane.')
    

    image

    • gBR_sBM_c05_d04_mBR0_ch08

    with the setting

    flags.DEFINE_string(
        'video_name',
        'gBR_sBM_c05_d04_mBR0_ch08',
        'input video name to be visualized.')
    flags.DEFINE_enum(
        'mode', 'SMPL', ['2D', '3D', 'SMPL', 'SMPLMesh'],
        'visualize 3D or 2D keypoints, or SMPL joints on image plane.')
    

    image

    • gJB_sBM_c06_d07_mJB3_ch05

    with the setting

    flags.DEFINE_string(
        'video_name',
        'gJB_sBM_c06_d07_mJB3_ch05',
        'input video name to be visualized.')
    flags.DEFINE_enum(
        'mode', 'SMPLMesh', ['2D', '3D', 'SMPL', 'SMPLMesh'],
        'visualize 3D or 2D keypoints, or SMPL joints on image plane.')
    

    image

    image

    I'm wondering if anyone else has similar results? Or did I make a mistake on the code running? Cause I found hundreds of videos like above.

    opened by juxuan27 2
  • Skip already downloaded files

    Skip already downloaded files

    Description: Skip already downloaded files (helpful to resume interrupted downloads)

    Additional Known Issues: With this method, it will not resume partially downloaded files. Workout suggestions for this issue in the future. -- If there is away to know expected file size then we could check for it. -- Each thread can save a last downloading file and remove them when done. Before resuming, delete all the incomplete files.

    opened by sneheshs 0
  • extract images

    extract images

    Hi, when i use ffmpeg_video_read to extract the image,i specified a frame rate of 60,but i found the number of frames and the number of corresponding motions are unequal. while if i don't specify fps,the number are equal. i use gHO_sBM_c01/02...09_d19_mHO2_ch02 .mp4 and get 481 images,but smpl poses only have 480.so do i need to specify the frame rate? Thanks!

    opened by jingwang97 3
Owner
Google
Google ❤️ Open Source
Google
Repo Home WPDrawBot - (Repo, Home, WP) A powerful programmatic 2D drawing application for MacOS X which generates graphics from Python scripts. (graphics, dev, mac)

DrawBot DrawBot is a powerful, free application for macOS that invites you to write Python scripts to generate two-dimensional graphics. The built-in

Frederik Berlaen 342 Dec 27, 2022
This repo contains scripts that add functionality to xbar.

xbar-custom-plugins This repo contains scripts that add functionality to xbar. Usage You have to add scripts to xbar plugin folder. If you don't find

osman uygar 1 Jan 10, 2022
Yunqi Chen 7 Oct 30, 2022
In this repo i inherit the pos module and added QR code to pos receipt

odoo-pos-inherit In this repo i inherit the pos module and added QR code to pos receipt 1- Create new Odoo Module using command line $ python odoo-bin

null 5 Apr 9, 2022
This repo presents you the official code of "VISTA: Boosting 3D Object Detection via Dual Cross-VIew SpaTial Attention"

VISTA VISTA: Boosting 3D Object Detection via Dual Cross-VIew SpaTial Attention Shengheng Deng, Zhihao Liang, Lin Sun and Kui Jia* (*) Corresponding a

null 104 Dec 29, 2022
💻 Algo-Phantoms-Backend is an Application that provides pathways and quizzes along with a code editor to help you towards your DSA journey.📰🔥 This repository contains the REST APIs of the application.✨

Algo-Phantom-Backend ?? Algo-Phantoms-Backend is an Application that provides pathways and quizzes along with a code editor to help you towards your D

Algo Phantoms 44 Nov 15, 2022
This repository contains code for building education startup.

Learning Management System Overview It's the code for EssayBrain, a tool for teacher that automatically grades and validates essays. In order to valid

Shyam Das Shrestha 1 Nov 21, 2021
This repository contains each day of Advent of Code 2021 that I've done.

Advent of Code - 2021 I will use this repository as my Advent of Code1 (AoC) repo for the 2021 challenge. I'm changing how I am tackling the problems

Brett Chapin 2 Jan 12, 2022
Contains the code of my learning of Python OOP.

OOP Python This repository contains the code of my learning of Python OOP. All the code: is following PEP 8 ✅ has proper concept illustrations and com

Samyak Jain 2 Jan 15, 2022
This repository contains the code for the python introduction lab

This repository contains the code for the python introduction lab. The purpose is to have a fairly simple python assignment that introduces the basic features and tools of python

null 1 Jan 24, 2022
A toy repo illustrating a minimal installable Python package

MyToy: a minimal Python package This repository contains a minimal, toy Python package with a few files as illustration for students of how to lay out

Fernando Perez 19 Apr 24, 2022
This is the repo for Uncertainty Quantification 360 Toolkit.

UQ360 The Uncertainty Quantification 360 (UQ360) toolkit is an open-source Python package that provides a diverse set of algorithms to quantify uncert

International Business Machines 207 Dec 30, 2022
This repo is related to Google Coding Challenge, given to Bright Network Internship Experience 2021.

BrightNetworkUK-GCC-2021 This repo is related to Google Coding Challenge, given to Bright Network Internship Experience 2021. Language used here is py

Dareer Ahmad Mufti 28 May 23, 2022
Educational Repo. Used whilst learning Flask.

flask_python Educational Repo. Used whilst learning Flask. The below instructions will be required whilst establishing as new project. Install Flask (

Jordan 2 Oct 15, 2021
Repo created for the purpose of adding any kind of programs and projects

Programs and Project Repository A repository for adding programs and projects of any kind starting from beginners level to expert ones Contributing to

Unicorn Dev Community 3 Nov 2, 2022
CalHacks 8 Repo: Megha Jain, Gaurav Bhatnagar, Howard Meng, Vibha Tantry

CalHacks8 CalHacks 8 Repo: Megha Jain, Gaurav Bhatnagar, Howard Meng, Vibha Tantry Setup FE Install React Native via Expo, run App.js. Backend Create

null 0 Aug 20, 2022
to learn how to do pull request and do contribution to other's repo

Hacktoberfest-2021 - open-source-contribution An Open Source repository to Teach people How to contribute to open sources. ?? ?? JOIN PVX PROGRAMMING

Shubham Rawat 82 Dec 26, 2022
hey, this repo is the backend of the sociio project

sociio backend Hey, this repository is a part of sociio project , In this repo we are working to create an independent server for everything you can i

null 2 Jun 9, 2022
Repo to demo translating colab/jupyter notebook to streamlit webapp

Repo to demo translating colab/jupyter notebook to streamlit webapp

Marisa Smith 2 Feb 2, 2022