farazBhatti / Human-Body-Measurements-using-Computer-Vision

Anthropometric measurement extraction using single image
Other
163 stars 62 forks source link

Human body measurement using computer vision/ 3D modeling

Anthropometric measurement extraction

alt text

Getting human body measurements from image is a very hard problem. This repository contains the source code and related files for a system that uses computer vision and 3D modeling techniques to accurately measure various body parts of a human subject.

The system is built on top of the OpenCV and Tensorflow libraries, which provide powerful tools for image processing, feature detection, and 3D reconstruction. It takes single image as input of a human subject and extracts key points. These key points are then used to build a 3D model of the subject, which can be used to precisely measure different body parts such as arm length, waist circumference, and hip width. This repository provides a starting solution for any one who is working in this domain. All meausrements are in centimeters. 3D reconstruction is done using HMR. Tested on tensorflow==1.13.1.

alt text

alt text

Download pre-trained model

Type the following command on the terminal to download pre-trained model

wget https://people.eecs.berkeley.edu/~kanazawa/cachedir/hmr/models.tar.gz && tar -xf models.tar.gz

and save it in 'models' folder.

CustomBodyPoints

Download CustomBodyPoints text file and place it in the data folder.

Install Packages

pip install -r requirements.txt or pip3 install -r requirements.txt

Jupyter NoteBook / Quick Demo

A Jupyter notebook has been added and updated for those who quickly want to get inference without much hassle. Simply change the path to your input image. Thanks to Hamza Khalil for adding this notebook.

Inference

python3 inference.py -i <path to Image1> -ht <height in cm>

My LinkedIn

FarazBhatti

Acknowledgment

HMR

Remove_background

Deep lab v3 +

Humanbody shape