Human Body Segmentation

Introduction

This program uses the BodyPix module obtained from the tf-js repository.
When the abc.html is run, it gives out an object containing the values for discriminating each inidvidual part of the human body.
The program can discriminate 24 parts of the human body.
Part Id - Part Name
-1 - (no body part)
0 - leftFace
1 - rightFace
2 - rightUpperLegFront
3 - rightLowerLegBack
4 - rightUpperLegBack
5 - leftLowerLegFront
6 - leftUpperLegFront
7 - leftUpperLegBack
8 - leftLowerLegBack
9 - rightFeet
10 - rightLowerLegFront
11 - leftFeet
12 - torsoFront
13 - torsoBack
14 - rightUpperArmFront
15 - rightUpperArmBack
16 - rightLowerArmBack
17 - leftLowerArmFront
18 - leftUpperArmFront
19 - leftUpperArmBack
20 - leftLowerArmBack
21 - rightHand
22 - rightLowerArmFront
23 - leftHand

Decoding the Data

When the abc.html is run, an array object is created.
This array object is then converted to .csv file format, where it contains the Part Id numbers for the image provided in the html code based on the image co-ordinates.

Usage

  1. Run the abc.html(Note-Replace the name of the source image file that u want to use with. The image must be of the size 640*480 resolution only).
    2.Check for the generated example_new.csv file.
    3.Run the BodyPix_latest.ipynb.(Note- Change the Part Id based on your requirement)
    4.Check for the saved results as morphed.jpg and detected_face.jpg.

The original repo - https://github.com/tensorflow/tfjs-models/tree/master/body-pix