Kimodo_OneClickStart / kimodo /docs /source /project_structure.md
Ye-Song's picture
Add files using upload-large-folder tool
7b853a5 verified
# 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 export formats
β”‚ β”‚ β”œβ”€β”€ bvh.py # BVH export
β”‚ β”‚ β”œβ”€β”€ mujoco.py # MuJoCo export
β”‚ β”‚ └── smplx.py # SMPL-X export
β”‚ β”œβ”€β”€ metrics/ # Evaluation metrics
β”‚ β”‚ β”œβ”€β”€ base.py # Metric base classes
β”‚ β”‚ β”œβ”€β”€ foot_skate.py # Foot skate metric
β”‚ β”‚ β”œβ”€β”€ constraints.py # Constraint satisfaction
β”‚ β”‚ └── tmr.py # TMR-based metrics
β”‚ β”œβ”€β”€ scripts/ # CLI and helper scripts
β”‚ β”‚ β”œβ”€β”€ generate.py # CLI for motion synthesis (kimodo_gen)
β”‚ β”‚ β”œβ”€β”€ run_text_encoder_server.py # Text encoder server (kimodo_textencoder)
β”‚ β”‚ β”œβ”€β”€ gradio_theme.py # Gradio theme for demo
β”‚ β”‚ β”œβ”€β”€ docker-entrypoint.sh # Docker entrypoint for demo
β”‚ β”‚ β”œβ”€β”€ lock_requirements.py # Dependency locking
β”‚ β”‚ β”œβ”€β”€ mujoco_load.py # MuJoCo scene loading
β”‚ β”‚ └── ... # Other helpers
β”‚ β”œβ”€β”€ 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
β”œβ”€β”€ 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_textencoder`** β€” text encoder server (`kimodo.scripts.run_text_encoder_server:main`)