gem-x-motion-capture / docs /INSTALL.md
cs686's picture
Deploy GEM-X ZeroGPU motion capture
49d36c0 verified
|
Raw
History Blame Contribute Delete
3.12 kB
# Installation
## Prerequisites
- Python 3.12+
- CUDA-compatible GPU with drivers supporting CUDA 12.6+
- [Git LFS](https://git-lfs.github.com/) (required for SOMA body model assets)
- [uv](https://github.com/astral-sh/uv) (fast Python package manager)
## Step 1 β€” Clone with submodules
```bash
git clone --recursive https://github.com/NVlabs/GEM-X.git
cd GEM-X
```
If you already cloned without `--recursive`:
```bash
git submodule update --init --recursive
```
## Step 2 β€” Create virtual environment
```bash
pip install uv
uv venv .venv --python 3.12
source .venv/bin/activate
```
## Step 3 β€” Install PyTorch with CUDA
```bash
# Adjust the CUDA version to match your GPU driver.
# See https://pytorch.org/get-started/locally/
uv pip install torch torchvision --index-url https://download.pytorch.org/whl/cu126
```
| CUDA Version | Index URL |
|---|---|
| CUDA 12.6 | `https://download.pytorch.org/whl/cu126` |
| CUDA 13.0 | `https://download.pytorch.org/whl/cu130` |
## Step 4 β€” Install SOMA body model
```bash
uv pip install -e third_party/soma
cd third_party/soma && git lfs pull && cd ../..
```
## Step 5 β€” Install GEM and dependencies
```bash
bash scripts/install_env.sh
```
This installs the `gem` package in editable mode along with Detectron2 for human detection.
## Step 6 β€” (Optional) Install SOMA Retargeter for humanoid robot retargeting
To enable `--retarget` mode (retarget recovered motion to the Unitree G1 robot):
```bash
uv pip install -e third_party/soma-retargeter
```
> **Note:** The soma-retargeter submodule requires SSH access. If `third_party/soma-retargeter` is empty, run:
> ```bash
> git submodule update --init third_party/soma-retargeter
> ```
## Step 7 β€” Third-party model assets
**SOMA body model** β€” follow `third_party/soma/README.md` and place model assets under `inputs/soma_assets/`.
**SAM-3D-Body** β€” follow `third_party/sam-3d-body/README.md` to download the checkpoint.
## Pretrained Model Download
Download the pretrained GEM checkpoint:
- **GEM (SOMA)**: [gem_soma.ckpt](https://huggingface.co/nvidia/GEM-X)
You can also download manually via CLI:
```bash
huggingface-cli download nvidia/GEM-X gem_soma.ckpt --local-dir inputs/pretrained
```
Place it under `inputs/pretrained/` or pass the path via `--ckpt`.
## Expected Directory Layout
After setup, your `inputs/` directory should look like:
```
inputs/
β”œβ”€β”€ pretrained/
β”‚ └── gem_soma.ckpt
β”œβ”€β”€ soma_assets/
β”‚ β”œβ”€β”€ soma_model/
β”‚ └── ...
└── sam3d/
└── checkpoint.pth
```
## Docker
A `Dockerfile` is provided at the repository root for reproducible setup. See the [Dockerfile](../Dockerfile) for details.
## Troubleshooting
| Issue | Solution |
|---|---|
| `git lfs` files are pointer files | Run `cd third_party/soma && git lfs pull` |
| CUDA version mismatch | Ensure PyTorch CUDA version matches your driver (`nvidia-smi`) |
| `ModuleNotFoundError: gem` | Ensure you ran `bash scripts/install_env.sh` with the venv activated |
| OpenGL/EGL errors | Set `PYOPENGL_PLATFORM=egl` and `EGL_PLATFORM=surfaceless` |