Giter VIP home page Giter VIP logo

Comments (7)

angus2292 avatar angus2292 commented on May 27, 2024 1

Thanks. I would try it

from smpl-anthropometry.

DavidBoja avatar DavidBoja commented on May 27, 2024

Hi,

In the main part of measure.py you can see how to generate the measurements:

if __name__ == "__main__":
smpl_path = "/SMPL-Anthropometry/data/SMPL"
measurer = MeasureSMPL(smpl_path=smpl_path)
betas = torch.zeros((1, 10), dtype=torch.float32)
measurer.from_smpl(gender="MALE", shape=betas)
measurement_names = MeasurementDefinitions.possible_measurements
measurer.measure(measurement_names)
print("Measurements")
pprint(measurer.measurements)
measurer.label_measurements(STANDARD_LABELS)
print("Labeled measurements")
pprint(measurer.labeled_measurements)
measurer.visualize()

The measurer.measurements and measurer.labeled_measurements are python dictionaries of measurements, which you can convert easily to json.

To use on your own data, you can adapt the same snippet i shared above. If you want to initialize the body model with the vertices of an already fitted SMPL body model to your scan, you can use:

MeasureSMPL(...).from_verts(verts)

instead of

MeasureSMPL(...).from_smpl(betas, gender)

as it says in the README file.

from smpl-anthropometry.

angus2292 avatar angus2292 commented on May 27, 2024

thanks for answering. So, what kind of input data I need to have? I'm still get in trouble about this.

from smpl-anthropometry.

DavidBoja avatar DavidBoja commented on May 27, 2024

There are two options for the input data:

  1. SMPL shape (called betas with dimension 1 x 10) and gender parameters. In this case you can initialize the measurer with:
MeasureSMPL(...).from_smpl(betas, gender)
  1. SMPL body vertices (called verts, dimension 6890 x 3). In this case you can initialize the measurer with:
MeasureSMPL(...).from_verts(verts)

In the first case your SMPL body is defined by its parameters, and in the second case it's defined with its vertices.

from smpl-anthropometry.

angus2292 avatar angus2292 commented on May 27, 2024

So, let me make a conclusion. If I want to use my own data, I need to have .obj file and fit the .from_verts function, right? If not, what kind of file type should I have. Sorry to bother you.

from smpl-anthropometry.

DavidBoja avatar DavidBoja commented on May 27, 2024

Yes, that is one of the options. Having 6890 3D vertices from the .obj file that correspond to an SMPL model. Then you can use the .from_verts function.

No problem -- I refined the README file to hopefully make things a bit more clear. Checkout the Running section and let me know if there are more questions.

from smpl-anthropometry.

DavidBoja avatar DavidBoja commented on May 27, 2024

Closing issue -- feel free to re-open if you will have further questions.

from smpl-anthropometry.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.