Comments (11)
@Daktha123
The second image code looks all right to me at first glance. You don't need the imports there but I guess they shouldn't hurt. I can't help you if I don't know what's actually wrong -- "program is not working" is not specific enough.
@NaToh5
You need to load the verts -- these are YOUR vertices that you should have. You can add them to the code as @Daktha123 did in the second image.
from smpl-anthropometry.
If I don't use "**verts = verts_tensor.float()*" I got this error " RuntimeError: expected scalar type Float but found Double ". That's why I use that code. Do you think that code might (verts = verts_tensor.float()) have a problem with the measurement process?
And also " measurer.visualize() " this is not working. Even I run measure.py the output only shows this
I need like this :
Updated : I already got the measurement visualization. I have to use local IDE to run the code , so that it will lead to browser to show the measurement visualization. Google Colab is not showing for the measurement visualization. Thank you for everything @DavidBoja
from smpl-anthropometry.
Hi,
Depending on the output of SHAPY and PYMAF you can do the following:
- If you have the SMPL shape
betas
and gendergender
parameters as your SHAPY or PYMAF outputs:
smpl_path = "/SMPL-Anthropometry/data/SMPL"
measurer = MeasureSMPL(smpl_path=smpl_path)
measurer.from_smpl(gender=gender, shape=betas)
measurement_names = MeasurementDefinitions.possible_measurements
measurer.measure(measurement_names)
measurer.label_measurements(STANDARD_LABELS)
- If you have the SMPL body vertices
verts
of shape 6890x3 as your SHAPY or PYMAF outputs:
smpl_path = "/SMPL-Anthropometry/data/SMPL"
measurer = MeasureSMPL(smpl_path=smpl_path)
measurer.from_verts(verts=verts)
measurement_names = MeasurementDefinitions.possible_measurements
measurer.measure(measurement_names)
measurer.label_measurements(STANDARD_LABELS)
Then, the measurer.measurements
and measurer.labeled_measurements
are python dictionaries of your measurements.
from smpl-anthropometry.
Thank you for getting back to me.
So the file format for verts is .npz file format right?
By the way, Is there any other way that can measure from 3D obj file?
from smpl-anthropometry.
So the file format for verts is .npz file format right?
The SMPL package uses pytorch as its standard for vectors/matrices/tensors. Therefore, if you have a .npz
file on your disk with the vertices, you can load them with numpy and then convert them into a torch tensor -- something like torch.from_numpy(loaded_numpy_vertices)
. As I mentioned however, the dimensions of the vertices needs to be (6890,3)
.
By the way, Is there any other way that can measure from 3D obj file?
Sure, load your .obj
file with trimesh -- something like verts = trimesh.load(scan_path, process=False).vertices
-- and then convert the verts
into a torch tensor as noted above torch.from_numpy(fitted_smpl)
.
from smpl-anthropometry.
Thank you for your fast response.
I have a problem when I run measure.py, it keeps showing me about .pkl file is not exist. But I just want to use verts.
So I have to provide both PKL file from SMPL and my own data file?
I run the code on Google Colab. If you have google colab, please share it with me.
Error " Path /content/SMPL-Anthropometry/data/SMPL/smpl/SMPL_NEUTRAL.pkl does not exist!"
from smpl-anthropometry.
As the README says:
Next, you need to provide the SMPL body models SMPL_{GENDER}.pkl (MALE, FEMALE and NEUTRAL), and put them into the data/SMPL/smpl folder.
Even if you initialize your body model using from_verts
, you still need to provide the SMPL body models because the code extracts the joint regressor from the SMPL body model in order to be able to find the joints from the provided vertices. The joints are needed to find some measurements.
This could in theory be avoided -- by rewriting the code and putting the joint regressor in this repository -- but I do not want to do that since I do not own licences to distribute their models. You can download their models from here.
from smpl-anthropometry.
I already check with my verts and it is match with your verts format. But I don't know how to put your code into measurement.py ? Becasue it keep showing me verts is not defined.
smpl_path = "/SMPL-Anthropometry/data/SMPL"
measurer = MeasureSMPL(smpl_path=smpl_path)
measurer.from_verts(verts=verts)
measurement_names = MeasurementDefinitions.possible_measurements
measurer.measure(measurement_names)
measurer.label_measurements(STANDARD_LABELS)
I put it in here but verts are not defined .
Could you also please tell me where should I put this in Measuremet.py " load your .obj file with trimesh -- something like verts = trimesh.load(scan_path, process=False).vertices -- and then convert the verts into a torch tensor as noted above torch.from_numpy(fitted_smpl)."
I update the internal code like this but the program is not working.
from smpl-anthropometry.
@Daktha123 Did you already solve that? I am still stuck at "measurer.from_verts(verts=verts)". I don't know how to add "verts" to the internal code.
from smpl-anthropometry.
I added these codes in measure.py . The program is working now and it load the verts perfectly. Could you please check it is correct ? Btw how can I show the measurement with 2D image like your show in the measurment_visulization.
scan_path = "/content/SMPL-Anthropometry/data/SMPL/smpl/John_0_smpl.obj"
verts = trimesh.load(scan_path, process=False).vertices
verts_tensor = torch.from_numpy(verts)
verts = verts_tensor.float()
from measure import MeasureSMPL
from measurement_definitions import MeasurementDefinitions, STANDARD_LABELS
smpl_path = "/content/SMPL-Anthropometry/data/SMPL"
measurer = MeasureSMPL(smpl_path=smpl_path)
measurer.from_verts(verts=verts_tensor)
from smpl-anthropometry.
@Daktha123
Yes, it looks good; you don't need the line verts = verts_tensor.float()
.
To get the visualizations you can use:
measurer.visualize()
This uses the plotly package and opens a visualization in the browser you can rotate.
from smpl-anthropometry.
Related Issues (16)
- How to generate own json? HOT 7
- Can visualize T-Pose? HOT 2
- how can i use the .obj file to measure? HOT 2
- Licence HOT 1
- Custom Measurements HOT 1
- Getting weight measurement HOT 13
- converts a 2D image into a 3D image HOT 1
- How to create 2d image to smpl format? HOT 3
- Can we put actual person Height to calculate with the other body parts ? HOT 2
- Is it possible to change Verts Dimension ? HOT 4
- please share link for SMPL_NEUTRAL.pkl HOT 2
- How to measure specific body parts? HOT 2
- How to load my own .pkl file or .obj file to measure? HOT 4
- Enable to use SMPLX model HOT 7
- How to measure length between the two mouse cursor? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smpl-anthropometry.