kimodo-motion-api / docs /source /project_structure.md
cs686's picture
Deploy Kimodo ZeroGPU motion API
a550c4e verified
|
Raw
History Blame Contribute Delete
7.23 kB
# Project Structure
```text
kimodo/
β”œβ”€β”€ kimodo/ # Main Python package
β”‚ β”œβ”€β”€ model/ # Model architecture and loading
β”‚ β”‚ β”œβ”€β”€ kimodo_model.py # Kimodo diffusion model wrapper
β”‚ β”‚ β”œβ”€β”€ twostage_denoiser.py # Two-stage denoising architecture
β”‚ β”‚ β”œβ”€β”€ backbone.py # Transformer encoder backbone
β”‚ β”‚ β”œβ”€β”€ diffusion.py # Diffusion process
β”‚ β”‚ β”œβ”€β”€ cfg.py # Classifier-free guidance
β”‚ β”‚ β”œβ”€β”€ common.py # Shared model utilities
β”‚ β”‚ β”œβ”€β”€ load_model.py # Model loading and registry lookup
β”‚ β”‚ β”œβ”€β”€ loading.py # Checkpoint loading utilities
β”‚ β”‚ β”œβ”€β”€ registry.py # Model registry (skeleton, checkpoint URLs)
β”‚ β”‚ β”œβ”€β”€ text_encoder_api.py # Text encoder API client
β”‚ β”‚ β”œβ”€β”€ tmr.py # TMR compatibility
β”‚ β”‚ └── llm2vec/ # LLM-based text encoder
β”‚ β”œβ”€β”€ motion_rep/ # Motion representation
β”‚ β”‚ β”œβ”€β”€ reps/ # Skeleton-specific motion reps
β”‚ β”‚ β”‚ β”œβ”€β”€ base.py # Base motion rep types
β”‚ β”‚ β”‚ β”œβ”€β”€ kimodo_motionrep.py
β”‚ β”‚ β”‚ └── tmr_motionrep.py
β”‚ β”‚ β”œβ”€β”€ conditioning.py # Conditioning (text, constraints)
β”‚ β”‚ β”œβ”€β”€ feature_utils.py # Feature extraction
β”‚ β”‚ β”œβ”€β”€ feet.py # Foot contact / smoothing
β”‚ β”‚ β”œβ”€β”€ smooth_root.py # Smooth root representation
β”‚ β”‚ └── stats.py # Normalization statistics
β”‚ β”œβ”€β”€ skeleton/ # Skeleton definitions and kinematics
β”‚ β”‚ β”œβ”€β”€ definitions.py # Skeleton topology (joints, chains)
β”‚ β”‚ β”œβ”€β”€ registry.py # Skeleton registry
β”‚ β”‚ β”œβ”€β”€ base.py # Base skeleton types
β”‚ β”‚ β”œβ”€β”€ kinematics.py # Forward kinematics
β”‚ β”‚ β”œβ”€β”€ transforms.py # Rotation/transform utilities
β”‚ β”‚ └── bvh.py # BVH I/O
β”‚ β”œβ”€β”€ viz/ # Visualization
β”‚ β”‚ β”œβ”€β”€ scene.py # 3D scene setup
β”‚ β”‚ β”œβ”€β”€ playback.py # Timeline / motion playback
β”‚ β”‚ β”œβ”€β”€ viser_utils.py # Viser 3D helpers
β”‚ β”‚ β”œβ”€β”€ gui.py # Demo GUI components
β”‚ β”‚ β”œβ”€β”€ constraint_ui.py # Constraint editing UI
β”‚ β”‚ β”œβ”€β”€ coords.py # Coordinate frames
β”‚ β”‚ β”œβ”€β”€ soma_skin.py # SOMA character skinning
β”‚ β”‚ β”œβ”€β”€ soma_layer_skin.py # SOMA layer-based skinning
β”‚ β”‚ β”œβ”€β”€ smplx_skin.py # SMPL-X skinning
β”‚ β”‚ └── g1_rig.py # G1 robot rig
β”‚ β”œβ”€β”€ demo/ # Interactive web demo
β”‚ β”‚ β”œβ”€β”€ app.py # Demo entry (Gradio / Viser)
β”‚ β”‚ β”œβ”€β”€ config.py # Demo configuration
β”‚ β”‚ β”œβ”€β”€ state.py # Application state
β”‚ β”‚ β”œβ”€β”€ ui.py # UI layout and callbacks
β”‚ β”‚ β”œβ”€β”€ generation.py # Generation pipeline for demo
β”‚ β”‚ β”œβ”€β”€ embedding_cache.py # Cached text embeddings
β”‚ β”‚ β”œβ”€β”€ queue_manager.py # Request queue for demo
β”‚ β”‚ └── __main__.py # Demo run as module
β”‚ β”œβ”€β”€ exports/ # Motion I/O and format conversion
β”‚ β”‚ β”œβ”€β”€ motion_io.py # Kimodo motion dict helpers (load, save, resample)
β”‚ β”‚ β”œβ”€β”€ motion_convert_lib.py # Library API for format conversion
β”‚ β”‚ β”œβ”€β”€ motion_formats.py # Format detection and FPS resolution
β”‚ β”‚ β”œβ”€β”€ bvh.py # SOMA BVH read/write
β”‚ β”‚ β”œβ”€β”€ mujoco.py # G1 MuJoCo qpos conversion
β”‚ β”‚ └── smplx.py # AMASS / SMPL-X conversion
β”‚ β”œβ”€β”€ metrics/ # Evaluation metrics
β”‚ β”‚ β”œβ”€β”€ base.py # Metric base classes
β”‚ β”‚ β”œβ”€β”€ foot_skate.py # Foot skate metrics
β”‚ β”‚ β”œβ”€β”€ constraints.py # Constraint metrics
β”‚ β”‚ └── tmr.py # TMR-based metrics
β”‚ β”œβ”€β”€ scripts/ # CLI and helper scripts
β”‚ β”‚ β”œβ”€β”€ generate.py # CLI for motion synthesis (kimodo_gen)
β”‚ β”‚ β”œβ”€β”€ motion_convert.py # CLI for format conversion (kimodo_convert)
β”‚ β”‚ β”œβ”€β”€ run_text_encoder_server.py # Text encoder server (kimodo_textencoder)
β”‚ β”‚ β”œβ”€β”€ gradio_theme.py # Gradio theme for demo
β”‚ β”‚ β”œβ”€β”€ lock_requirements.py # Dependency locking
β”‚ β”‚ └── mujoco_load.py # MuJoCo g1 csv loading
β”‚ β”œβ”€β”€ assets/ # Package data (shipped with package)
β”‚ β”‚ β”œβ”€β”€ demo/ # Demo examples and config
β”‚ β”‚ └── skeletons/ # Skeleton assets
β”‚ β”œβ”€β”€ constraints.py # Constraint definitions and handling
β”‚ β”œβ”€β”€ geometry.py # Geometric utilities
β”‚ β”œβ”€β”€ postprocess.py # Post-processing (e.g. MotionCorrection)
β”‚ β”œβ”€β”€ meta.py # Motion metadata
β”‚ β”œβ”€β”€ sanitize.py # Input sanitization
β”‚ β”œβ”€β”€ assets.py # Asset path resolution
β”‚ └── tools.py # General utilities
β”œβ”€β”€ benchmark/ # Evaluation pipeline scripts
β”‚ β”œβ”€β”€ create_benchmark.py # Step 1: Build test suite from SEED + metadata
β”‚ β”œβ”€β”€ generate_eval.py # Step 2: Generate motions for test suite
β”‚ β”œβ”€β”€ embed_folder.py # Step 3: Embed motions and text with TMR
β”‚ β”œβ”€β”€ evaluate_folder.py # Step 4: Compute metrics for test cases
β”‚ └── parse_folder.py # Step 5: Aggregate and display results
β”œβ”€β”€ MotionCorrection/ # Optional C++/Python post-processing
β”‚ β”œβ”€β”€ python/motion_correction/ # Python bindings
β”‚ └── src/cpp/ # C++ implementation
β”œβ”€β”€ docs/ # Documentation (Sphinx)
β”‚ └── source/ # RST/MD sources
β”œβ”€β”€ assets/ # Repo-level assets (banner, screenshots)
β”œβ”€β”€ pyproject.toml # Package config and entry points
β”œβ”€β”€ setup.py # Setuptools entry (if needed)
β”œβ”€β”€ Dockerfile # Container image for demo
β”œβ”€β”€ docker-compose.yaml # Docker Compose for demo + text encoder
└── README.md
```
Entry points (from `pyproject.toml`):
- **`kimodo_gen`** β€” command-line motion synthesis (`kimodo.scripts.generate:main`)
- **`kimodo_demo`** β€” interactive web demo (`kimodo.demo:main`)
- **`kimodo_convert`** β€” motion format conversion (`kimodo.scripts.motion_convert:main`)
- **`kimodo_textencoder`** β€” text encoder server (`kimodo.scripts.run_text_encoder_server:main`)