← Open Source
GuyTevet

MotionCLIP

Official Pytorch implementation of the paper "MotionCLIP: Exposing Human Motion Generation to CLIP Space".

ModelsDomain-specific modelsEmbedding ModelsPython
Open on GitHub
Momentum
+0stars in 24 hours0.0%
503
Stars
45
Forks
+0
This week
2
Contributors
Created 2022-03-14 · Updated 2026-10-02 · #18250 today
Top developers
GuyTevetBrianG13

GuyTevet/MotionCLIP is ranked 18,250 with 503 stars.

Same-category comparison

GuyTevet/MotionCLIP is ranked 18,250 among these 8 peers; PengBoXiangShang/SiamRPN_plus_plus_PyTorch is ranked 18,253.

Same-category comparison
NameRankMetrics
PITI-Synthesis/PITI18,225
Language:
Python
Stars:
504
Forks:
26
Description:
PITI: Pretraining is All You Need for Image-to-Image Translation.
frank-xwang/UnSAM18,233
Language:
Jupyter Notebook
Stars:
504
Forks:
27
Description:
[NeurIPS 2024] Code release for "Segment Anything without Supervision".
rosinality/alias-free-gan-pytorch18,242
Language:
Python
Stars:
504
Forks:
43
Description:
Unofficial implementation of Alias-Free Generative Adversarial Networks. (https://arxiv.org/abs/2106.12423) in PyTorch.
sail-sg/metaformer18,243
Language:
Python
Stars:
504
Forks:
31
Description:
MetaFormer Baselines for Vision (TPAMI 2024).
PengBoXiangShang/SiamRPN_plus_plus_PyTorch18,253
Language:
Python
Stars:
503
Forks:
89
Description:
SiamRPN, SiamRPN++, unofficial implementation of "SiamRPN++" (CVPR2019), multi-GPUs, LMDB.
lumina37/rotate-captcha-crack18,262
Language:
Python
Stars:
503
Forks:
118
MarcoForte/FBA_Matting18,277
Language:
Jupyter Notebook
Stars:
502
Forks:
95
Description:
Official repository for the paper F, B, Alpha Matting.
facebookresearch/jepa-wms18,288
Language:
Python
Stars:
502
Forks:
64
Description:
Code, data and weights for the paper **What drives success in physical planning with Joint-Embedding Predictive World Models.
Key parameters and specifications
Key parameters and specifications
ParameterValue
LanguagePython
CategoryModels
SubcategoryDomain-specific models, Embedding Models
Keywords3D, Datasets, Model architecture, Multimodal
Stars503
Forks45
Contributors2
Created date2022-03-14
Updated date2026-10-02
Stars in 1 day0
Stars in 7 days0
Rank18,250
Previous rank18,002
Rank change-248
7-day stars rank16,554
Previous 7-day stars rank16,571
7-day stars rank change17
Total stars rank19,272
Previous total stars rank19,246
Total stars rank change-26
CountryIsrael
README summary

MotionCLIP Official Pytorch implementation of the paper **"MotionCLIP: Exposing Human Motion Generation to CLIP Space"**. Please visit our **webpage** for more details. Bibtex If you find this code useful in your research, please cite: Updates **31/AUG/22** - Training loop reproduces paper results. (a bug fix) **11/MAY/22** - First release. Create conda environment The code was tested on Python 3. Download the parsed data directly** Parsed AMASS dataset -> If you prefer to parse the data yourself, follow this: Download

and unzip the above datasets and place them correspondingly: AMASS -> (Download the SMPL+H version for each dataset separately, please note to download ALL the dataset in AMASS website) BABEL -> Rendered AMASS images -> Then, process the three datasets into a unified dataset with triplets: To parse acording to the AMASS split (for all applications except action recognition), run: **Only if** you intend to use **Action Recognition**, run also: 3. Download the SMPL body model This will download the SMPL neutral

model from this **github repo** and additionnal files. In addition, download the **Extended SMPL+H model** (used in AMASS project) from MANO, and place it in . Using the pretrained model First, download the model and place it at 1. Text-to-Motion To reproduce paper results, run: To run MotionCLIP with your own texts, create a text file, with each line depicts a different text input (see as a reference) and point to it with instead. Vector Editing To reproduce

paper results, run: To gain the input motions, we support two modes: - Retrieve motions from train/validation sets, according to their textual label. On it first run, generates a file containing a list of all textual labels. You can look it up and choose motions for your own editing. - The inputs are free texts, instead of motions. We use CLIP text encoder to get CLIP representations, perform vector editing, then use MotionCLIP decoder to output the edited motion. To run

MotionCLIP on your own editing, create a csv file, with each line depicts a different edit (see as a reference) and point to it with instead. Interpolation To reproduce paper results, run: To gain the input motions, we use the mode described earlier. To run MotionCLIP on your own interpolations, create a csv file, with each line depicts a different interpolation (see as a reference) and point to it with instead. Action Recognition For action recognition, we use a model

trained on text class names. Train your own ~~**NOTE (11/MAY/22):** The paper model is not perfectly reproduced using this code. The trained model checkpoint we provide does reproduce results. ~~ **(Resolved 31/AUG/22)** To reproduce run: To reproduce run: Acknowledgment The code of the transformer model and the dataloader are based on ACTOR repository. License This code is distributed under an MIT LICENSE. Note that our code depends on other libraries, including CLIP, SMPL, SMPL-X, PyTorch3D, and

uses datasets which each have their own respective licenses that must also be followed.

Frequently asked questions

How many stars and forks are recorded?

GuyTevet/MotionCLIP has 503 stars and 45 forks.

What is the repository rank?

GuyTevet/MotionCLIP is ranked 18,250.

What language and category are recorded?

GuyTevet/MotionCLIP has 503 stars, uses Python and belongs to Models.

Which repository is closest in rank?

GuyTevet/MotionCLIP is compared with PengBoXiangShang/SiamRPN_plus_plus_PyTorch, ranked 18,253 with 503 stars.

README

MotionCLIP

Official Pytorch implementation of the paper "MotionCLIP: Exposing Human Motion Generation to CLIP Space".

Please visit our webpage for more details.

Bibtex

If you find this code useful in your research, please cite:

@article{tevet2022motionclip,
title={MotionCLIP: Exposing Human Motion Generation to CLIP Space},
author={Tevet, Guy and Gordon, Brian and Hertz, Amir and Bermano, Amit H and Cohen-Or, Daniel},
journal={arXiv preprint arXiv:2203.08063},
year={2022}
}

Updates

31/AUG/22 - Training loop reproduces paper results. (a bug fix)

11/MAY/22 - First release.

Getting started

1. Create conda environment

conda env create -f environment.yml
conda activate motionclip

The code was tested on Python 3.8 and PyTorch 1.8.1.

2. Download data

NEW! Download the parsed data directly

Parsed AMASS dataset -> ./data/amass_db

If you prefer to parse the data yourself, follow this:

Download and unzip the above datasets and place them correspondingly:

  • AMASS -> ./data/amass (Download the SMPL+H version for each dataset separately, please note to download ALL the dataset in AMASS website)

  • BABEL -> ./data/babel_v1.0_release

  • Rendered AMASS images -> ./data/render

    Then, process the three datasets into a unified dataset with (text, image, motion) triplets:

To parse acording to the AMASS split (for all applications except action recognition), run:

python -m src.datasets.amass_parser --dataset_name amass

Only if you intend to use Action Recognition, run also:

python -m src.datasets.amass_parser --dataset_name babel

3. Download the SMPL body model

bash prepare/download_smpl_files.sh

This will download the SMPL neutral model from this github repo and additionnal files.

In addition, download the Extended SMPL+H model (used in AMASS project) from MANO, and place it in ./models/smplh.

Using the pretrained model

First, download the model and place it at ./exps/paper-model

1. Text-to-Motion

To reproduce paper results, run:

 python -m src.visualize.text2motion ./exps/paper-model/checkpoint_0100.pth.tar --input_file assets/paper_texts.txt

To run MotionCLIP with your own texts, create a text file, with each line depicts a different text input (see paper_texts.txt as a reference) and point to it with --input_file instead.

2. Vector Editing

To reproduce paper results, run:

 python -m src.visualize.motion_editing ./exps/paper-model/checkpoint_0100.pth.tar --input_file assets/paper_edits.csv

To gain the input motions, we support two modes:

  • data - Retrieve motions from train/validation sets, according to their textual label. On it first run, src.visualize.motion_editing generates a file containing a list of all textual labels. You can look it up and choose motions for your own editing.
  • text - The inputs are free texts, instead of motions. We use CLIP text encoder to get CLIP representations, perform vector editing, then use MotionCLIP decoder to output the edited motion.

To run MotionCLIP on your own editing, create a csv file, with each line depicts a different edit (see paper_edits.csv as a reference) and point to it with --input_file instead.

3. Interpolation

To reproduce paper results, run:

 python -m src.visualize.motion_interpolation ./exps/paper-model/checkpoint_0100.pth.tar --input_file assets/paper_interps.csv

To gain the input motions, we use the data mode described earlier.

To run MotionCLIP on your own interpolations, create a csv file, with each line depicts a different interpolation (see paper_interps.csv as a reference) and point to it with --input_file instead.

4. Action Recognition

For action recognition, we use a model trained on text class names. Download and place it at ./exps/classes-model.

python -m src.utils.action_classifier ./exps/classes-model/checkpoint_0200.pth.tar

Train your own

NOTE (11/MAY/22): The paper model is not perfectly reproduced using this code. We are working to resolve this issue. The trained model checkpoint we provide does reproduce results. (Resolved 31/AUG/22)

To reproduce paper-model run:

python -m src.train.train --clip_text_losses cosine --clip_image_losses cosine --pose_rep rot6d \
--lambda_vel 100 --lambda_rc 100 --lambda_rcxyz 100 \
--jointstype vertices --batch_size 20 --num_frames 60 --num_layers 8 \
--lr 0.0001 --glob --translation --no-vertstrans --latent_dim 512 --num_epochs 100 --snapshot 10 \
--device  \
--dataset amass \
--datapath ./data/amass_db/amass_30fps_db.pt \
--folder ./exps/my-paper-model

To reproduce classes-model run:

python -m src.train.train --clip_text_losses cosine --clip_image_losses cosine --pose_rep rot6d \
--lambda_vel 95 --lambda_rc 95 --lambda_rcxyz 95 \
--jointstype vertices --batch_size 20 --num_frames 60 --num_layers 8 \
--lr 0.0001 --glob --translation --no-vertstrans --latent_dim 512 --num_epochs 200 --snapshot 10 \
--device  \
--dataset babel \
--datapath ./data/amass_db/babel_30fps_db.pt \
--folder ./exps/my-classes-model

Acknowledgment

The code of the transformer model and the dataloader are based on ACTOR repository.

License

This code is distributed under an MIT LICENSE.

Note that our code depends on other libraries, including CLIP, SMPL, SMPL-X, PyTorch3D, and uses datasets which each have their own respective licenses that must also be followed.

Nearby in the ranking
Similar items