Spaces:
Running on L40S
Download README.md from nvidia/Cosmos3-Action-Viewer: direct link, hf CLI and curl.
- Browser
- Download file 4.19 kB
-
https://huggingface.co/spaces/nvidia/Cosmos3-Action-Viewer/resolve/main/README.md
- Command line
-
hf download hf://spaces/nvidia/Cosmos3-Action-Viewer/README.md
-
curl -L -o README.md https://huggingface.co/spaces/nvidia/Cosmos3-Action-Viewer/resolve/main/README.md
title: Cosmos3 Action Viewer
emoji: π€
colorFrom: blue
colorTo: green
sdk: docker
app_port: 7860
pinned: false
license: other
Cosmos3 Action Viewer
An interactive, browser-based viewer for robot action datasets that runs Cosmos3 world-model generation locally. Three modes are supported:
- Forward dynamics β predict future video frames from a sequence of actions.
- Inverse dynamics β predict the actions that connect observed frames.
- Policy β predict the next actions to take.
The app serves the Viser frontend and runs Cosmos3 generation in a single
process. Packaged demo data ships under assets/examples/, so you can try every
mode without downloading any datasets β you only need the model checkpoint.
Run Locally
You need an NVIDIA GPU with >= 48GiB memory and the NVIDIA Container Toolkit installed.
One time, download the Cosmos3-Nano checkpoint:
hf download nvidia/Cosmos3-Nano --local-dir app_data/models/Cosmos3-Nano
To run:
# Build the image.
docker build -t cosmos3-action-viewer .
# Launch docker, mounting the directory that holds the model.
docker run --rm --gpus all -p 8020:7860 \
-v "$(pwd)/app_data:/app_data" \
cosmos3-action-viewer
Then open http://localhost:8020.
The container looks for the checkpoint under /app_data/models/ (the mount
above), so any of these on-disk layouts work:
app_data/models/Cosmos3-Nanoapp_data/models/nvidia--Cosmos3-Nano
On first launch the model is warmed up in the background. A generation requested before warmup finishes simply waits for it to complete, then reuses the loaded pipeline β so the first generation is the slowest and later ones are faster.
Customizing a Launch
All behavior is controlled through environment variables, which you can pass to
docker run with -e NAME=value. The most useful ones:
Checkpoint / data locations:
ACTION_VIZ_CHECKPOINT_LOCAL_PATHβ explicit checkpoint path, or a colon-separated list of candidate paths to try in order.ACTION_VIZ_MODEL_MOUNT_PATHβ explicit path to a mounted Hugging Face model.ACTION_VIZ_APP_DATA_ROOTβ root for app data inside the container (default/app_data); models are resolved under<root>/models/.ACTION_VIZ_OUTPUT_ROOTβ where generated artifacts are written (default/tmp/action_viz_sessions). Artifacts are cleaned up after each generation/session.
Generation settings:
ACTION_VIZ_GENERATE_IMAGE_SIZEβ output resolution (default480).ACTION_VIZ_GENERATE_NUM_FRAMESβ frames per generation (default24).ACTION_VIZ_GENERATE_NUM_STEPSβ sampling steps (default30).ACTION_VIZ_DEFAULT_DATASETβ dataset selected on load (defaultbridge).ACTION_VIZ_USE_TORCH_COMPILEβtorch.compilethe pipeline (default1). The first generation pays a one-time compile cost in exchange for faster subsequent runs.ACTION_VIZ_BACKGROUND_WARMUPβ warm the model on startup (default1); set to0for a lightweight UI-only start that skips loading the model.
Example β lower resolution, fewer steps, and a different default dataset:
docker run --rm --gpus all -p 8020:7860 \
-v "$(pwd)/app_data:/app_data" \
-e ACTION_VIZ_GENERATE_IMAGE_SIZE=320 \
-e ACTION_VIZ_GENERATE_NUM_STEPS=15 \
-e ACTION_VIZ_DEFAULT_DATASET=droid \
cosmos3-action-viewer
Diagnostics
Check how the checkpoint is being resolved (read-only, no model load):
docker run --rm --gpus all \
-v "$(pwd)/app_data:/app_data" \
cosmos3-action-viewer python /app/scripts/checkpoint_diagnostic.py
Run a one-step generation smoke test without the browser UI (temporary artifacts are cleaned up by default):
docker run --rm --gpus all \
-v "$(pwd)/app_data:/app_data" \
cosmos3-action-viewer \
python /app/scripts/local_generation_smoke.py --model-mode forward_dynamics --num-steps 1
docker run --rm --gpus all \
-v "$(pwd)/app_data:/app_data" \
cosmos3-action-viewer \
python /app/scripts/local_generation_smoke.py --model-mode policy --num-steps 1