GuyTevet / motion-diffusion-model

The official PyTorch implementation of the paper "Human Motion Diffusion Model"
MIT License
3.12k stars 336 forks source link

How can I edit motion which is generated with a text? #37

Closed heury closed 1 year ago

heury commented 1 year ago

Motion-edit example shows editing motion in the dataset. Would you show me how to edit motion which is generated with a text?

GuyTevet commented 1 year ago

This is a feature we will not add in the near future but you can patch it following these steps:

(1) While generating the motion, at https://github.com/GuyTevet/motion-diffusion-model/blob/fc1439fdcee47c16988519a43f72f60f74bbc987/sample/generate.py Save not only the joint positions (as we do now), but also the raw output of the MDM, which will then be loaded for editing.

(2) To edit the generated motion, load it in https://github.com/GuyTevet/motion-diffusion-model/blob/fc1439fdcee47c16988519a43f72f60f74bbc987/sample/edit.py and override the motions from the dataset with your generated motions.

heury commented 1 year ago

Thanks for your response. I will try it.