• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
vinod

vinod

Demo

Public
Like
Demo
Home
Code
4
backend
5
frontend
1
shared
1
README.md
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
Code
/
Search
index.ts
https://vinod--1287a13a3bbc11f0a3519e149126039e.web.val.run
README.md

Body Measurement System

A computer vision application that calculates body measurements from a single photo using OpenCV and MediaPipe pose detection.

Features

  • Upload a person's photo
  • Automatic pose detection using MediaPipe
  • Calculate key body measurements:
    • Height
    • Shoulder width
    • Chest/Bust circumference
    • Waist circumference
    • Hip circumference
    • Arm length
    • Leg length (inseam)
    • Neck circumference
    • Wrist circumference
    • And more tailoring measurements

How it works

  1. Pose Detection: Uses MediaPipe to detect 33 key body landmarks
  2. Reference Scaling: Uses known body proportions or user-provided reference measurements
  3. Anthropometric Calculations: Applies standard body measurement formulas
  4. Real-time Processing: Processes images and returns measurements instantly

Usage

  1. Upload a clear, full-body photo (front-facing preferred)
  2. Optionally provide a reference measurement (like height) for better accuracy
  3. Get comprehensive body measurements suitable for tailoring

Technical Stack

  • Backend: Hono.js with pose detection and measurement calculations
  • Frontend: React with image upload and results display
  • Computer Vision: Currently uses mock pose detection (see integration guide below)
  • Calculations: Anthropometric formulas for body measurements
  • Styling: TailwindCSS for responsive design

File Structure

β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ index.ts              # Main API server
β”‚   β”œβ”€β”€ pose-detection.ts     # MediaPipe pose detection
β”‚   β”œβ”€β”€ measurements.ts       # Body measurement calculations
β”‚   └── utils.ts             # Helper functions
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ index.html           # Main page
β”‚   β”œβ”€β”€ App.tsx              # React app component
β”‚   └── components/          # UI components
└── shared/
    └── types.ts             # Shared TypeScript types

API Endpoints

  • POST /api/measure - Upload image and get body measurements
  • POST /api/report - Download measurements as text file
  • GET /api/health - Health check endpoint
  • GET /api/docs - API documentation
  • GET / - Serve the main application

Real Pose Detection Integration

This demo currently uses mock pose detection for demonstration purposes. To integrate with real pose detection:

Option 1: MediaPipe (Recommended for accuracy)

npm install @mediapipe/pose @mediapipe/camera_utils

Option 2: TensorFlow.js PoseNet (Good for server-side)

npm install @tensorflow/tfjs-node @tensorflow-models/posenet

Option 3: OpenCV (Lightweight option)

npm install opencv4nodejs

See /backend/real-pose-integration.ts for detailed implementation examples.

Current Implementation

The system currently:

  • βœ… Provides a complete web interface for image upload
  • βœ… Validates image format and size
  • βœ… Implements comprehensive measurement calculations
  • βœ… Uses anthropometric formulas for accurate estimations
  • βœ… Provides confidence scoring
  • βœ… Generates downloadable measurement reports
  • ⚠️ Uses mock pose detection (needs real implementation)

Measurement Accuracy

The measurement calculations are based on established anthropometric research and provide:

  • Primary measurements: Height, shoulder width, chest, waist, hip circumferences
  • Arm measurements: Full arm, upper arm, forearm lengths and circumferences
  • Leg measurements: Leg length, inseam, thigh, calf circumferences
  • Tailoring measurements: Neck, armhole, back/front widths, and key distances

Accuracy depends on:

  1. Photo quality: Clear, well-lit, full-body images
  2. Pose quality: Upright stance with arms slightly away from body
  3. Reference measurement: Providing actual height significantly improves accuracy
  4. Pose detection quality: Real implementation will be more accurate than mock
HTTP
  • index.ts
    vinod--12…9e.web.val.run
Code
backendfrontendsharedREADME.md
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
ExploreDocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
Β© 2025 Val Town, Inc.