2D HOI Generation#
Synthesizes short videos of a human interacting with a 3D object, by chaining physics simulation, multi-view Blender rendering, and a video foundation model (default: Kling AI).
Quickstart#
Run the 2D HOI pipeline through its package module from the repo root. This stage does not have a project-root wrapper script.
python -m grail.pipelines.gen_2dhoi \
--dataset ComAsset --category cordless_drill \
--character kid \
--results_dir results --video_model_api kling-ai
Outputs:
results/generation/initial_states/— physics-stable orientations.results/generation/asset_renders/— rendered scene PNGs.results/generation/cameras/anddepth_maps/— geometric ground truth.results/generation/videos_kling/— the generated MP4s.
Pipeline steps#
Stage |
Notes |
|
|---|---|---|
1 |
Object simulation |
Drop the object from a small height in Blender + Bullet, settle, save the
final orientation. Skipped via |
2 |
Scale optimization |
Iterative Blender render + chat-vision evaluation (small/big/correct).
Skipped by default in |
3 |
Multi-view rendering |
|
4 |
Video generation |
Refines the prompt via chat-vision, then calls Kling AI image→video (5 s, pro mode by default). Polls every 30 s up to 120 attempts. |
Required environment#
Variable |
Why |
|---|---|
|
Prompt refinement (step 4) and scale evaluation (step 2) through the OpenAI API. Defaults use |
|
Kling AI HTTP API. |
Common variants#
# Skip simulation (cached) and scale (already in obj_scale.json)
python -m grail.pipelines.gen_2dhoi --dataset ComAsset --category cordless_drill \
--character kid --skip_step1 --skip_step2 \
--results_dir results
# Render only — no Kling video gen
python -m grail.pipelines.gen_2dhoi --dataset ComAsset --category cordless_drill \
--character kid --skip_step1 --skip_step2 --skip_step4 \
--results_dir results
# Use a custom config (e.g., terrain stairs)
python -m grail.pipelines.gen_2dhoi --config configs/gen_2dhoi/terrain_stairs.yaml \
--results_dir results
Configs#
File |
Purpose |
|---|---|
|
Standard table-top / handheld manipulation |
|
Sitting interactions (chair-class objects) |
|
Terrain traversal — curbs |
|
Terrain traversal — slopes |
|
Terrain traversal — stairs |
Object-specific overrides (scale, scene, etc.) live in configs/objects/.