KimYC1223 / 3D-Body-Estimation

Python Based 3D Body Esimation With UDP Protocol
17 stars 3 forks source link

How to get the body measurements? #3

Open lyz2 opened 3 years ago

lyz2 commented 3 years ago

Hello, could you tell me the method to measure the body_control_points.txt?Import the 3D human body template into Unity and draw the points of these 19 measurements manually?I really need your help, thank you.

KimYC1223 commented 3 years ago

About training data set

Hello @lyz2!

First of all, I'm really glad that you're interested in my project.

But my answer doesn't seem to help.... 😥

I think you are trying to create new running data set.

Perhaps you saw the body_control_points.txt in the train.py.

However, As noted in the ReadMe, I just used the already created data set.

And this means that I have never ran the train.py in this project.

So... I'm so sorry but I don't know what exactly the contents of body_control_points.txt mean,

and I don't know how to create body_control_points.txt.


However, when I build this project, I referenced other GitHub projects.

I'll give you a GitHub repo link.

So I don't know about body_control_points.txt, but she know.

She explains in detail how she creates her 3D body on her GitHub readme.

image


I hope you can find what you are looking for there. 😀

Thank you !!

lyz2 commented 3 years ago

oh,thank you. I have another question,What do you do with Unity and python?

KimYC1223 commented 3 years ago

Objectives of the project

The purpose of this project is to estimate the 3D body (mesh) in Unity at runtime.

For example, the system I wanted to make with this project is a smart mirror.

The smart mirror received the user's height and weight and showed the expected body shape.

To implement this in Unity, I developed a function to communicate with Python, an external binary.

When Unity sends a request, Python estimates and exports the 3d body mesh.

To summarize what I'm saying:


📚 1. What the reference project did

  • 1.1 Estimate 3D objects by creating a learning model based on body size data

    ⚙️ 2. What this project does

  • 2.1 : Changed the existing GUI to new interface that operates with UDP packet communication
  • 2.2 : When Unity sends a request through a UDP packet, Python binary parses the packet and estimates the 3D body mesh based on the sent value
  • 2.3 : When the estimate is complete, export it to an OBJ file and notify Unity.

    🖥 3. What the Unity project should do

  • 3.1 : Information (height, weight, etc.) that will be a clue for estimation is delivered in UDP packets
  • 3.2 : If the estimate is complete(when 2.3 is done), the mesh is imported in Unity at runtime

The contents described in this Git Hub are 2 and 3. What is stored in the repository is 2 only.

Content 3 can be implemented through a simple code in Readme.

  override public string ToString() {
        string result = "";
        result += this.weight + "/";
        result += this.height + "/";
        result += (this.neck != 0)?this.neck + "/": "/";
        result += (this.chest != 0)?this.chest + "/": "/";
        result += (this.belly_button_waist != 0)?this.belly_button_waist + "/": "/";
        result += (this.gluteal_hip != 0)?this.gluteal_hip + "/": "/";
        result += (this.neck_shoulder_elbow_wrist != 0)?
                  this.neck_shoulder_elbow_wrist + "/": "/";
        result += (this.crotch_knee_floor != 0)?this.crotch_knee_floor + "/": "/";
        result += (this.across_back_shoulder_neck != 0)?
                  this.across_back_shoulder_neck + "/": "/";
        result += (this.neck_to_gluteal_hip != 0)?this.neck_to_gluteal_hip + "/": "/";
        result += (this.natural_waist != 0)?this.natural_waist + "/": "/";
        result += (this.max_hip != 0)?this.max_hip + "/": "/";
        result += (this.natural_waist_rise != 0)?this.natural_waist_rise + "/": "/";
        result += (this.shoulder_to_midhand != 0)?this.shoulder_to_midhand + "/": "/";
        result += (this.upper_arm != 0)?this.upper_arm + "/": "/";
        result += (this.wrist != 0)?this.wrist + "/": "/";
        result += (this.outer_natural_waist_to_floor != 0)?
                  this.outer_natural_waist_to_floor + "/": "/";
        result += (this.knee != 0)?this.knee + "/": "/";
        result += (this.max_thigh != 0) ? this.max_thigh.ToString(): "";
        return result;
}
// Testing.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Testing : MonoBehaviour
{
    void Update() {
        if (Input.GetKeyDown(KeyCode.A)) {
            BodyEstimation.GetInstance().sendBodySpec(45f, 170f, false);
            // 45kg 170cm female
        } else if (Input.GetKeyDown(KeyCode.S)) {
            BodyEstimation.GetInstance().sendBodySpec(120f, 150f, false);
            // 120kg 150cm female
        } else if (Input.GetKeyDown(KeyCode.D)) {
            BodyEstimation.GetInstance().sendBodySpec(60f, 180f, true);
            // 60kg 180cm male
        } else if (Input.GetKeyDown(KeyCode.F)) {
            BodyEstimation.GetInstance().sendBodySpec(130f, 170f, true);
            // 130kg 170cm male
        }
    }
}

This is expressed in a figure as follows:

image

I wish my answer will be help for you.

thank you!

lyz2 commented 3 years ago

Thank you for your patience. Your explanation is too detailed. I fully understand. Thank you very much!!!!! Is your project an intelligent measuring mirror? Do you have any related papers, or have you already worked?

KimYC1223 commented 3 years ago

Body measuring based on point cloud

I'm truly sorry for the late response.

This project is part of my lab research,

And of the entire study, I was in charge of estimating 3D bodies at Unity through measured body information,

so I don't know exactly how the actual body was measured. 😥

But if I were to explain it as briefly as I know it,

We use depth camera to generate a point cloud,

then create a mesh through these clouds by rotating the object 360 degrees and capturing it.

The depth camera we used is Intel's RealSense D400, and We referenced the RecFusion library.


Example

When I scan a box with a side length of 11.5 cm and a total circumference of 46 cm,

the error is less than 1 cm. (If there is no noise)

image

image

That's all I can help you with.

I don't know the details either.

I wish my answer will be help for you again! good luck 🤞

suptec19 commented 3 years ago

Hello, I found your project very interesting. Unfortunatally during the installation of the needed packages some of the versions you report are too old and are automatically unistalled and substituted (i.e. numpy during the installation of scipy and traits during the installation of mayavi). At the end running the demo program I receive errors. Can you either update your list of programs that need to be installed or specify the exact version also for mayavi and scipy. Thank you very much

lyz2 commented 3 years ago

Thank you very much for your reply.  My research topic is also to create a three-dimensional human body according to the human body size parameters. Is the human body you created represented by triangular mesh?

------------------ 原始邮件 ------------------ 发件人: "KimYC1223/3D-Body-Estimation" @.>; 发送时间: 2021年10月27日(星期三) 上午10:41 @.>; @.**@.>; 主题: Re: [KimYC1223/3D-Body-Estimation] How to get the body measurements? (Issue #3)

Body measuring based on point cloud

I'm truly sorry for the late response.

This project is part of my lab research,

And of the entire study, I was in charge of estimating 3D bodies at Unity through measured body information,

so I don't know exactly how the actual body was measured. 😥

But if I were to explain it as briefly as I know it,

We use depth camera to generate a point cloud,

then create a mesh through these clouds by rotating the object 360 degrees and capturing it.

The depth camera we used is Intel's RealSense D400, and We referenced the RecFusion library.

Example

When I scan a box with a side length of 11.5 cm and a total circumference of 46 cm,

the error is less than 1 cm. (If there is no noise)

That's all I can help you with.

I don't know the details either.

I wish my answer will be help for you again! good luck 🤞

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

KimYC1223 commented 3 years ago

Thank you very much for your reply.  My research topic is also to create a three-dimensional human body according to the human body size parameters. Is the human body you created represented by triangular mesh?

Triangular mesh ?

That sounds like an interesting research topic! 😁

I think that it looked like a triangular mesh, but it's not accurate.

It's been a long time since I've worked, I don't remember very well.

A way to check this is to run this project again,

But right now, I don't have much time because I'm studying for a master's degree in graduate school.

So... I'll fix Issue 4 and answer it as soon as possible.