$ show zju3dv/EasyMocap
EasyMocap is a multi-view 3D human motion capture toolbox designed for research and prototyping. It provides end-to-end pipelines from video input to 3D body mesh recovery, including camera calibration, 2D keypoint detection (via OpenPose, HRNet, MediaPipe, YOLO), multi-view association and triangulation, SMPL/SMPL-X body model fitting, and neural body rendering. The architecture is modular: a config-driven factory pattern (via YAML and `load_object`) instantiates pipeline stages (detection, triangulation, fitting, visualization), and a command-line entry point `emc` orchestrates the workflow. The repository also contains annotation tools, a real-time 3D visualization server using Open3D, and neural body research code (NeRF-based) for novel view synthesis. Despite its research character, the core pipeline is structured as a reusable application framework with separate packages for estimators, operations, and visualization. However, the codebase exhibits significant technical debt: hardcoded paths, duplicated modules (e.g., two HRNet implementations), incomplete error handling, mixed Chinese/English comments, and stale vendored dependencies (Eigen 3.3.7, pybind11). There are no unit tests, and many scripts rely on external model checkpoints that may not be accessible. The repository is actively maintained with recent commits, but the code quality reflects a fast-moving research project rather than a production-grade system.
The LLM identified 4 files worth highlighting for reuse:
Provides a `Timer` context manager and `TimerReport` class for performance profiling. Tracks elapsed time per named block, supports hierarchical timing, and outputs a formatted report with min/max/avg times. Isolated and reusable in any Python project requiring simple instrumentation.
Unified I/O utilities for reading/writing JSON, NumPy arrays, SMPL parameters, camera data, and annotation files. Handles common data exchange formats in 3D vision pipelines (keypoints, bboxes, SMPL poses/shapes). Idempotent and well-structured; can be extracted for use in other human pose projects.
Implements batch and iterative triangulation from multi-view 2D keypoints using SVD-based linear triangulation. Includes robust view selection (RANSAC-like), iterative refinement, and optional outlier removal. Self-contained with only NumPy/OpenCV dependencies, demonstrating a clean pattern for multi-view 3D reconstruction.
Provides utilities for handling mirror reflections in multi-view mocap: computes mirror transforms from plane normals, flips SMPL parameters and keypoints, and permutes joints. Used to augment data by reflecting the scene. The geometric transform logic (plane reflection, joint permutation) is self-contained and applicable to any mirror-based augmentation pipeline.