gemx_soma_diffusers / README.md
OzzyGT's picture
OzzyGT HF Staff
Upload README.md
83071f4 verified
|
Raw History Blame Contribute Delete
3.25 kB
metadata
language:
  - en
license: other
license_name: nvidia-open-model-license
license_link: >-
  https://www.nvidia.com/en-us/agreements/enterprise-software/nvidia-open-model-license/
base_model:
  - nvidia/GEM-X
  - PekingU/rtdetr_r101vd_coco_o365
library_name: diffusers
tags:
  - gem-x
  - modular-diffusers
  - motion-capture
  - pose-estimation
  - video
  - soma

GEM-X SOMA Diffusers

Left: the camera-space skeleton and 2D keypoints. Right: the world motion. The clip is AI-generated, the first frame with MiniMax-H3-Image and the video with MiniMax-H3.

A Diffusers conversion of the native77 body model of nvidia/GEM-X, which reconstructs the 3D motion of one person in a video. This repository holds the weights, configs and model code: the RT-DETR person detector, GEM-X's keypoint model, pose encoder and motion transformer, and Kimodo's neutral SOMA77 skeleton.

For model details, see the original model card and the GEM-X repository.

Usage

Install PyTorch for your GPU, then:

pip install "diffusers>=0.41.0" "transformers>=5.3.0" "torchvision>=0.25" "opencv-python-headless>=4.10" "scipy>=1.11" imageio imageio-ffmpeg

The model runs with the GEM-X SOMA Modular Diffusers blocks.

Note: trust_remote_code=True runs the code of the blocks repository and trust_components_code=True the model code in this one, both downloaded from the Hub. Only use them with repositories you trust.

import numpy as np
import torch
from diffusers import ModularPipelineBlocks
from diffusers.utils import load_video


blocks = ModularPipelineBlocks.from_pretrained(
    "OzzyGT/gemx_soma_custom_blocks",
    trust_remote_code=True,
    components_repo="OzzyGT/gemx_soma_diffusers",
    trust_components_code=True,
)
pipe = blocks.init_pipeline()
pipe.load_components(dtype=torch.float32)
pipe.to("cuda")

video = load_video("clip_30fps.mp4")
motion = pipe(video=video, output="motion")
np.savez_compressed("motion.npz", **{key: value.cpu().numpy() for key, value in motion.items()})

The clip must be at 30 FPS. The result is a SOMA77 motion in meters, +Y up, with Kimodo's joint order and rotation convention; the blocks can also return the SOMA body parameters. The feet are locked in place while they touch the floor; pass foot_lock=False for GEM-X's raw prediction. Use float32, which matches GEM-X. See the blocks for the inputs and outputs.

Licenses