Views
No views yet
.bag files recorded with the Intel RealSense D455 depth camera. Captures from 3 viewpoints (front, left, right) are fused into a unified 3D body scan, from which anthropometric measurements are computed.| Measurement | Method | Typical Accuracy |
|---|---|---|
| Height | Point cloud bounding box + landmark validation | < 1% error |
| Weight | Body volume integration × density (985 kg/m³) | ~5-10% error |
| Neck Circumference | Cross-section slice + radial filtering | ~10-15% error |
| Chest Circumference | Cross-section slice with torso isolation | ~5-10% error |
| Waist Circumference | Narrowest torso cross-section | ~5-10% error |
| Hip Circumference | Widest cross-section at hip level | ~5% error |
| Wrist Circumference | Forearm-perpendicular cross-section | < 2% error |
| Shoulder Width | Bi-acromial landmark distance | < 1% error |
| BMI | Derived from height + estimated weight | — |
1# Clone the repo
2git clone https://huggingface.co/mdashraf9723/body3d-realsense-measurements
3cd body3d-realsense-measurements
4
5# Install Python packages
6pip install -r requirements.txt
7
8# On Ubuntu/Debian, you also need:
9sudo apt-get install libgl1-mesa-glx libglib2.0-0Headless server? Usepip install open3d-cpuinstead ofopen3d.
[LEFT CAM]
↓ (90°)
🧍 ← Person (arms slightly out, A-pose)
[FRONT CAM] → ← [RIGHT CAM]
(0°) (-90°) front.bagleft.bagright.bag1import pyrealsense2 as rs
2import time
3
4pipeline = rs.pipeline()
5config = rs.config()
6config.enable_stream(rs.stream.depth, 1280, 720, rs.format.z16, 30)
7config.enable_stream(rs.stream.color, 1280, 720, rs.format.bgr8, 30)
8config.enable_record_to_file("front.bag") # change name for each view
9
10pipeline.start(config)
11time.sleep(5) # Record 5 seconds
12pipeline.stop()
13print("Done!").bag files in the same folder as the scripts, then run:1python pipeline.py \
2 --front front.bag \
3 --left left.bag \
4 --right right.bag \
5 --output my_measurements.json1python pipeline.py \
2 --front front.bag \
3 --left left.bag \
4 --right right.bag \
5 --angles 0 -90 90 \
6 --output my_measurements.jsonpython pipeline.py --bag front.bag --output my_measurements.jsonpython pipeline.py --demomy_measurements.json will look like:1{
2 "height_cm": 175.0,
3 "estimated_weight_kg": 72.5,
4 "bmi": 23.7,
5 "neck_circumference_cm": 38.2,
6 "chest_circumference_cm": 94.5,
7 "waist_circumference_cm": 82.1,
8 "hip_circumference_cm": 96.3,
9 "wrist_circumference_cm": 16.4,
10 "shoulder_width_cm": 44.0
11}============================================================
BODY MEASUREMENTS
============================================================
Height............................. 175.0 cm
Estimated Weight................... 72.5 kg
BMI................................ 23.7
----------------------------------------
Neck Circumference................. 38.2 cm
Chest Circumference................ 94.5 cm
Waist Circumference................ 82.1 cm
Hip Circumference.................. 96.3 cm
Wrist Circumference................ 16.4 cm
----------------------------------------
Shoulder Width..................... 44.0 cm
============================================================| What you have | Command |
|---|---|
3 .bag files (front, left, right) | python pipeline.py --front front.bag --left left.bag --right right.bag |
1 .bag file | python pipeline.py --bag recording.bag |
| No camera, just testing | python pipeline.py --demo |
python pipeline.py --help
Options:
--demo Run with synthetic test data (no camera needed)
--bag FILE Single .bag file path
--front FILE Front view .bag file
--left FILE Left view .bag file
--right FILE Right view .bag file
--angles FLOAT... Camera angles in degrees (e.g. 0 -90 90)
--output FILE Output JSON path (default: measurements.json)
--voxel-size FLOAT Point cloud resolution in meters (default: 0.01)
--max-depth FLOAT Max depth from camera in meters (default: 3.0)
--save-ply FILE Save merged point cloud to PLY file.bag files (3 views) → bag_reader.py → registration.py → landmarks.py → measurements.py → JSON output.bag files via pyrealsense2, applies spatial/temporal/hole-filling filters, extracts aligned depth+color frames, generates Open3D point clouds with camera intrinsicsbody3d-realsense-measurements/
├── pipeline.py # Main entry point (CLI)
├── bag_reader.py # Module 1: RealSense .bag file reader
├── registration.py # Module 2: Multi-view point cloud registration
├── landmarks.py # Module 3: MediaPipe body landmarks
├── measurements.py # Module 4: Body measurement computation
├── requirements.txt # Python dependencies
└── README.md # This file✓ height_cm.............. GT: 175.0 Est: 175.0 Err: 0.0 (0.0%)
✓ chest_circumference.... GT: 94.2 Est: 85.7 Err: 8.5 (9.1%)
✓ waist_circumference.... GT: 81.7 Est: 85.6 Err: 3.9 (4.7%)
✓ hip_circumference...... GT: 97.4 Est: 93.1 Err: 4.3 (4.5%)
⚠ neck_circumference..... GT: 37.7 Est: 43.0 Err: 5.3 (14.2%)
✓ wrist_circumference.... GT: 15.7 Est: 15.6 Err: 0.1 (0.7%)
✓ shoulder_width......... GT: 44.0 Est: 44.0 Err: 0.0 (0.0%)smplx: pip install smplxpip install git+https://github.com/DavidBoja/SMPL-Anthropometry