facebookresearch / DensePose

A real-time approach for mapping all human pixels of 2D RGB images to a 3D surface-based model of the body
http://densepose.org
Other
6.98k stars 1.3k forks source link

How to generate 24 parts UV fields of a SMPL model? #116

Closed ypflll closed 6 years ago

ypflll commented 6 years ago

As mentioned in the paper: For head, hands and feet, we use the manually obtained UV fields provided in the SMPL model. For the rest of the parts we obtain the unwrapping via multidimensional scaling applied to pairwise geodesic distances. Then we get this: image

Is there any code to generate this UV map? And what is the corresponence between this map with 6890 SMPL vertices?

roboticlemon commented 6 years ago

This is definitely the biggest mystery at the moment!

jaggernaut007 commented 6 years ago

https://arxiv.org/abs/1809.01995 This paper should get you going.

ypflll commented 6 years ago

@jaggernaut07 Thanks. @ingramator I'll try this. If having progress, I'll share here.

ypflll commented 6 years ago

@jaggernaut07 Densepose transfer using two STN networks to map and inverse map the texture map, while densepose use manually obtained UV fields provided in the SMPL model and pairwise geodesic distances. However, both of them provide code, so I have to implement by myself.

roboticlemon commented 6 years ago

@ypflll Thankyou! Would love to hear about any progress.

I think as far as that new paper is concerned this is the only part of the architecture I'm concerned with, doing the mapping from person to model, with their pose as well. image

ypflll commented 6 years ago

I find two softwares can generate uv map: zbrush and mari, but not very clear how they do so.

jaggernaut007 commented 6 years ago

@ypflll I was planning to use unity for visualization from text, after getting the iuv data. Is zbrush or mari better?

ypflll commented 6 years ago

@jaggernaut07 Sorry, not familar with these tools.

roboticlemon commented 6 years ago

@jaggernaut07 any progress on using Unity? The SMPLify module supports unity rendering.

jaggernaut007 commented 6 years ago

Yup. Going to use unity . But have to convert it to the unity txt format to get it up and running on my player. Will let you know if it works out.

On Fri, 21 Sep 2018, 10:09 am ingramator, notifications@github.com wrote:

@jaggernaut07 https://github.com/jaggernaut07 any progress on using Unity? The SMPLify module supports unity rendering.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/facebookresearch/DensePose/issues/116#issuecomment-423411032, or mute the thread https://github.com/notifications/unsubscribe-auth/Al5HtLhWG8JNXZJXUmlfJ8nEf5kPedmxks5udG11gaJpZM4Wo6_J .

kinsou commented 6 years ago

@ypflll Can you tell me how the texture is generated? I also have no way to generate textures.

ypflll commented 6 years ago

I find that in SMPL model, UV map has been included. Using visual studio or autodesk's fbx-sdk (https://www.autodesk.com/developer-network/platform-technologies/fbx-sdk-2019-0) you can extract it.

@kinsou When you get the uv map, I think you can get the texture map.

kinsou commented 6 years ago

@ypflll I won't use this kind of software, can I share the UV map cropping code?

GianKiMoon commented 6 years ago

I'm also very curious about this, since the uv of the SMPL does not give any clues on how they created the other parts. Maybe the authors could clarify this? @ralpguler @nneverova Thanks.

image

GianKiMoon commented 6 years ago

Has anybody had any progress with this issue? I would appreciate any kind of help :)

ypflll commented 6 years ago

@GianKiMoon As I mentioned above, you can use autodesk's fbx-sdk. Why not bother to download and try it?

GianKiMoon commented 6 years ago

@ypflll Ok, sorry if I didn't get this right. But I also exported the included uv map (just in blender) and achieved different results (see my previous post). So if I use the Autodesk SDK for export of the same model I can get exactly the texture from the original work? I thought I have to use a different method for exporting the other maps besides the head, hands and feets which I can generate from the SMPL uvs. Thanks.

ypflll commented 6 years ago

@GianKiMoon Using Autodesk SDK I get UV map like you. If you want to get the same texture with the author who use 'pairwise geodesic distances', I think the author may give more info @ralpguler @nneverova

GianKiMoon commented 6 years ago

@ypflll your refrence was the thing I needed, thank you! So for all others who are as blind as me: UV_data. Just execute the script to get the MatLab files. You can create a simple MatLab script like this in the same folder: load('UV_Processed.mat'); plot(All_U,All_V,'.')

Which finally produces this output: grafik

tschnz commented 5 years ago

I'm gonna hijack this issue a little bit. The authors of the paper don't seem to respond anymore and all questions regarding texture are not getting answered by them at all. @ralpguler @nneverova

Currently I'm looking for a way to convert a SMPL texture to a DensePose texture atlas. That would pave the way for HiRes textures and would be an easy way to really generate your own textures:

  1. Load the SMPL model in your favorite texture painting program
  2. Texture 3D models given the SMPL UV map
  3. Export the textured/painted UV map
  4. Convert to DensePose texture atlas

From the discussion here I quite don't think this was solved or I'm blind. Are the 1x24 Matlab cells called _Utransforms and _Vtransforms in _UV_symmetrytransforms.mat key to solving this?

So here my question again, visualized: Has someone the code or a sophisticated hint on how to get from the SMPL UV map that looks like this:

SMPL UV Map

to the Texture Atlas looking like this:

DensePose Texture Atlas

First goal would be to convert these textures as proof of concept.

ypflll commented 5 years ago

@tschnz They are two ways to discretize human body. I am using the first one getting from autodesk's fbx-sdk. It provides vertice index(0~6889). I think you can take a look at the second one, and if it also provides vertice index, these two maps can be converted.

BostonLobster commented 5 years ago

@ypflll Hi, thanks for your sharing! And now I have a new problem may relate to your concern. Given an image and its IUV, how to generate the 24 parts textures maps like those provided in SURREAL dataset? The DensePose-RCNN-Texture-Transfer.ipynb file shows how to do texture transfer, and my question is how to texture inverse transfer given an image and its IUV data.

tschnz commented 5 years ago

@BostonLobster The 24 part texture atlas is provided by DensePose. The SURREAL dataset textures are normal textures (not atlases). I think what you need is discussed at the end of #68

jaggernaut007 commented 5 years ago

Seems easy, infer the iuv points. Connect them to the ronce you already have. Search for dense pose transfer . You'll get a better idea

On Sun, 17 Feb 2019, 8:30 pm Jens Schindel, notifications@github.com wrote:

@BostonLobster https://github.com/BostonLobster The 24 part texture atlas is provided by DensePose. The SURREAL dataset textures are normal textures (not atlases). I think what you need is discussed at the end of

68 https://github.com/facebookresearch/DensePose/issues/68

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/facebookresearch/DensePose/issues/116#issuecomment-464467420, or mute the thread https://github.com/notifications/unsubscribe-auth/Al5HtCdMaCiwfALkjVsx3_Od_scMzgj0ks5vOW6TgaJpZM4Wo6_J .

BostonLobster commented 5 years ago

@BostonLobster The 24 part texture atlas is provided by DensePose. The SURREAL dataset textures are normal textures (not atlases). I think what you need is discussed at the end of #68

@tschnz Yes! You're right, that's what I need. Thank you very much!

tschnz commented 5 years ago

@ypflll Could you share the code to generate the UVs from SMPL using the FBX SDK? :)

ypflll commented 5 years ago

@tschnz I use fbx-sdk2019.0\samples\UVSample in this:

https://www.autodesk.com/developer-network/platform-technologies/fbx-sdk-2019-0 Just load basicModel_f_lbs_10_207_0_v1.0.2.FBX, and then save the vertice uv cooodinates. I'll share this when I have time to clean my code later.

JustinhoCHN commented 5 years ago

@tschnz hi, have you figure out have to do the convertion?

jaggernaut007 commented 5 years ago

What conversion>?

On Mon, May 6, 2019 at 7:08 PM Justin.h notifications@github.com wrote:

@tschnz https://github.com/tschnz hi, have you figure out have to do the convertion?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/facebookresearch/DensePose/issues/116#issuecomment-489623468, or mute the thread https://github.com/notifications/unsubscribe-auth/AJPEPNFM6VLS6A4EVUL5QC3PUAYEPANCNFSM4FVDV7EQ .

M-Usman10 commented 5 years ago

I'm willing to convert SMPL textures to ATLAS. Has someone found a single python script to do that?

polygonfuture commented 5 years ago

@GianKiMoon Does the matlab script only generate the ATLAS mapped UV layouts as an image, or will it also translate and properly warp an original source SMPL texture image?

GianKiMoon commented 5 years ago

@polygonfuture The script was just to plot the UV layout. I haven't tried to warp the original textures to Atlas, sorry.

polygonfuture commented 5 years ago

@GianKiMoon Oh, but they already provide the UV layout in the repository.

Have you taken a look at the densepose_methods.py file? It looks like it may be handling the uv mapping in this section.

What I am not clear on is if there is any way to use the default SMPL layout rather than their ATLAS layout.

Their ATLAS layout makes it very annoying to re-texture, and you lose the ability to paint textures in 3D space from the SMPL model uv space.

GianKiMoon commented 5 years ago

@polygonfuture I haven't looked at densepose_methods.py extensively, but it seems that it maps an iuv coordinate of their texture ATLAS to a surface point of the standard SMPL body model in T-Pose. Maybe if you have the mapping from the "normal" texture map to the surface points, you can find the right relation.

ZhiRuoo commented 5 years ago

has anyone solved this issue yet? i have downloaded Autodesk SDK. I also have Blender.And I also have the base SMPL model. What exactly should I do to extract this texture map and then how to map a given picture and extract the texture to map to this SMPL back.

kuboshizuma commented 4 years ago

I created a python library ( https://github.com/kuboshizuma/UVTextureConverter ) to make the conversion easy. It helps to convert atlas texture (defined in DensePose) to normal texture (defined in SMPL), and vice versa. If you still have problems with this issue, try it !

mwang259 commented 2 years ago

@ypflll Hi, could you share the method: How to use Autodesk SDK to get UV map like above, Now, I need to add texture map to 3D model.Thank you very much!