{"id":29055102,"url":"https://github.com/javtahir/live-measurements-api","last_synced_at":"2026-06-20T04:31:06.026Z","repository":{"id":298877229,"uuid":"1001407266","full_name":"JavTahir/Live-Measurements-Api","owner":"JavTahir","description":"API to extract body measurements from front and side images using computer vision.","archived":false,"fork":false,"pushed_at":"2025-06-13T10:44:38.000Z","size":256,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-04T00:42:54.530Z","etag":null,"topics":["body-measurement-api","computer-vision","flask","image-processing","pose-estimation"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JavTahir.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-13T10:24:10.000Z","updated_at":"2025-09-02T16:39:27.000Z","dependencies_parsed_at":"2025-06-13T11:47:30.862Z","dependency_job_id":null,"html_url":"https://github.com/JavTahir/Live-Measurements-Api","commit_stats":null,"previous_names":["javtahir/live-measurements-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/JavTahir/Live-Measurements-Api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JavTahir%2FLive-Measurements-Api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JavTahir%2FLive-Measurements-Api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JavTahir%2FLive-Measurements-Api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JavTahir%2FLive-Measurements-Api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JavTahir","download_url":"https://codeload.github.com/JavTahir/Live-Measurements-Api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JavTahir%2FLive-Measurements-Api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34557551,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-20T02:00:06.407Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["body-measurement-api","computer-vision","flask","image-processing","pose-estimation"],"created_at":"2025-06-27T03:40:15.193Z","updated_at":"2026-06-20T04:31:05.971Z","avatar_url":"https://github.com/JavTahir.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AI-Based Human Body Measurement System for Tailoring \u0026 Fashion E-Commerce\n\nThis project is a real-time body measurement API built with **Flask**, **MediaPipe**, **OpenCV**, and **PyTorch**. By analyzing **front and side pose images** of a person, it calculates accurate human body measurements useful for tailoring, clothing size prediction, and virtual fitting rooms.\n\n\u003e 📸 Just send **front and side pose images** (captured using a smartphone or webcam) to this API, and receive key body measurements in centimeters — perfect for fashion retail platforms and tailor-made garment businesses.\n\n---\n\n## Features\n\n- Real-time image-based body measurement\n- AI-powered depth estimation using **MiDaS**\n- Measurement accuracy with a deviation of **±2-3 cm**\n- Calibrates scale using an **A4 paper** as a reference object\n- Easily integratable into fashion e-commerce or tailoring platforms\n- No external APIs — runs entirely on your local or server environment\n\n---\n\n\n## Libraries Used\n\n| Library         | Purpose                                                                 |\n|----------------|-------------------------------------------------------------------------|\n| `Flask`        | To expose a simple HTTP API                                             |\n| `OpenCV`       | For image processing and contour detection                              |\n| `MediaPipe`    | For pose landmark detection (shoulders, hips, etc.)                     |\n| `PyTorch`      | For AI-based **depth estimation** using [MiDaS](https://github.com/isl-org/MiDaS) |\n| `torchvision`  | Support for model loading \u0026 image transformations                       |\n\n---\n\n# How It Works\n\n1. Detects key landmarks using **MediaPipe Pose** (shoulders, hips, knees, ankles).\n2. Uses **A4 paper** in the image to calibrate real-world scale from pixels.\n3. Enhances width and depth estimation using the **MiDaS depth AI model**.\n4. Calculates measurements using geometric approximations (**elliptical body model**).\n5. Returns measurement data in **JSON format**.\n\n\n## How to Run\n\n```bash\npip install -r requirements.txt\npython app.py\n```\n\n\n# API Endpoint\n\n**POST** `/measurements`\n\n\u003e ℹ️ For reference, see the images placed  in the root directory.\n\n---\n##  Request\nSend a `multipart/form-data` **POST** request with the following fields:\n\n- **`front_image`**: JPEG/PNG image captured from the front *(required)*\n- **`side_image`** *(optional)*: JPEG/PNG image from the side *(for better accuracy)*\n- **`user_height_cm`** : Real height of the person (in cm) for more precise calibration\n\n---\n\n###  Example using `curl`\n\n```bash\ncurl -X POST http://localhost:5000/measurements \\\n  -F \"front_image=@front.jpg\" \\\n  -F \"side_image=@side.jpg\" \\\n  -F \"user_height_cm=170\"\n```\n\n# Measurements Provided\n\n| **Measurement Name**     | **Description**                                                   |\n|--------------------------|-------------------------------------------------------------------|\n| `shoulder_width`         | Distance between left and right shoulders                        |\n| `chest_width`            | Width at chest level                                              |\n| `chest_circumference`    | Estimated chest circumference                                     |\n| `waist_width`            | Width at waist level                                              |\n| `waist`                  | Estimated waist circumference                                     |\n| `hip_width`              | Distance between left and right hips                             |\n| `hip_circumference`      | Estimated hip circumference *(if side image is given)*           |\n\n---\n\n\u003e 📌 **Note:**  \n\u003e The system uses **AI depth maps** and **contour-based width detection**.  \n\u003e Final measurements may have a **±2–3 cm variance** depending on image quality and user alignment.\n\n\n# Integration in Fashion E-Commerce\n\nThis solution is plug-and-play for:\n\n- **E-commerce brands** offering size suggestions or virtual try-ons.\n- **Tailoring platforms** wanting remote client measurements.\n- **Clothing manufacturers** personalizing size charts for customers.\n- **Fashion mobile apps** for custom-fitted clothing suggestions.\n\nSimply integrate this API into your frontend — mobile or web — to collect two photos and retrieve exact measurements.\n\n\n## 🤝 Contributions\n\nPRs and suggestions are welcome! Fork this repo, raise an issue, or open a pull request.\n\n## 📜 License\n\nMIT License. Feel free to use this for personal or commercial projects — just give credit.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavtahir%2Flive-measurements-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjavtahir%2Flive-measurements-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavtahir%2Flive-measurements-api/lists"}