miraymen / pix2surf

Learning to Transfer Texture from Clothing Images to 3D Humans, CVPR 2020
Other
342 stars 62 forks source link

Use customized texture and prepare training data #4

Open qzane opened 4 years ago

qzane commented 4 years ago

Hi, this project is awesome and thanks for sharing the code. I'm trying to test the result with my own texture, and my understanding is that I should first train a new model with my own shirt image and its mask, right?. However when I trying to run /prep_data/run.py I got some issue: I don't know where to find and how to install psbody-mesh and psbody-smpl 0.1. Could you also give more details about the environment for prep_data? Because I find you are using cPickle which is in Python2 while your main demo is using Python3.6.9.

wangfudong commented 4 years ago

I manually download psbody-mesh and psbody-smpl from https://github.com/MPI-IS/mesh and https://smpl.is.tue.mpg.de/, respectively. For installation, first, just following the installation in MPI-IS/mesh, the package psbody.mesh will be installed into your vitual-env (I use Anaconda3). Then, you can unzip and put the package smpl into the directory of ./bspoby, just with the same level of the folder mesh.

Note that, the original package smpl is only compatible with python2, and it can not be directly used. You need to make some minor modifications.

wangfudong commented 4 years ago

I also find some problems of compatibility between python2 vs python3 when executing ./prep_data/run.py.

qzane commented 4 years ago

I manually download psbody-mesh and psbody-smpl from https://github.com/MPI-IS/mesh and https://smpl.is.tue.mpg.de/, respectively. For installation, first, just following the installation in MPI-IS/mesh, the package psbody.mesh will be installed into your vitual-env (I use Anaconda3). Then, you can unzip and put the package smpl into the directory of ./bspoby, just with the same level of the folder mesh.

Note that, the original package smpl is only compatible with python2, and it can not be directly used. You need to make some minor modifications.

Thanks for your reply, I'll try to install MPI-IS/mesh. Could you also tell me the python2 version your using for that? Thanks!

wangfudong commented 4 years ago

Hi qzane, After one day's struggle I have solved this problem in a troublesome way. I installed psbody-mesh 0.1 from https://github.com/TimoBolkart/mesh and bulit it by executing 'make', and then moved the generated folder ./psbody into the ./site-packages of a virtualenv of python2.7. If you want, give me an email adress and I will send an installation doc to you.

qzane commented 4 years ago

Hi qzane, After one day's struggle I have solved this problem in a troublesome way. I installed psbody-mesh 0.1 from https://github.com/TimoBolkart/mesh and bulit it by executing 'make', and then removed the generated folder ./psbody into the ./site-packages of a virtualenv of python2.7. If you want, give me an email adress and I will send an installation doc to you.

Thank you so much, my email is: qzane@live.com

coreqode commented 4 years ago

Hey @qzane @wangfudong, were you able to get the b-maps and f-maps for new garment meshes?

trinanjan12 commented 3 years ago

@wangfudong, @qzane I am also stuck installing psbody mesh and smpl. could you please sent me the steps also. Thank you! trinanjan1993.@gmail.com

trinanjan12 commented 3 years ago

Update on how to execute run.py. the run.py supports only python2 and after generating the data you can shift to python3 env for training(i haven't trained myself)

  1. Download the google drive files mentioned inside the scrips folder. keep the data folder inside train dir and assets in the root dir
  2. Create a virtualenv virtualenv ~/.virtualenv/pymesh2.7 -p python2.7 source ~/.virtualenv/pymesh2.7/bin/activate
  3. install chumpy=0.69 using the following(pip install chumpy was show some pip req problem) pip install git+https://github.com/scottandrews/chumpy.git@fe51783e0364bf1e9b705541e7d77f894dd2b1ac

4.pip install opencv-python==4.0.1.24 pip install scipy==1.2.0

5.go to https://github.com/MPI-IS/mesh/releases and download v0.1 whl file for python2 pip install wheel file should install mesh

  1. pip install pillow==5.0.0 pip install numpy==1.14.5 pip install openDR==0.77

  2. follow @wangfudong advice of manually copying the smpl folder to ./site-packages of a virtualenv . Basically the psbody-mesh is installed inside the site-packages of the virtualenv(pymesh2.7 for me). Trace the location of psbody-mesh inside the virtualenv in your system and copy the smpl folder to ./site-packages/psbody. So now psbody will have 2 folders, mesh and smpl. (smpl folder has to be downloaded from smpl website for python2)

now go inside prep_data and execute run.py. This will take the example from the train/data/pants/front and generate the necessary folders. run.py will show path error for psbody smpl. Fix this by using the correct path. example: in smpl_paths.py from psbody.smpl.smpl_webuser.serialization import load_model

in ch_smpl.py from psbody.smpl.smpl_webuser.posemapper import posemap, Rodrigues from psbody.smpl.smpl_webuser.serialization import backwards_compatibility_replacements

Question Does anyone have any idea how to generate output for high-resolution images? Because the output resolution is not quite good. The textures/patterns of the clothes are not that visible. How come this is different from what has been showcased on the paper??

chenw191 commented 3 years ago

Hi @qzane @wangfudong @trinanjan12 ,can you execute run.py correctly? The result I got is very strange, human and clothing meshes are vertically rotated and character cannot fit clothes: 1

trinanjan12 commented 3 years ago

I haven't worked on it for a while. This repo wasn't documented that well

chenw191 commented 3 years ago

@trinanjan12 sorry to disturb you, but may I ask a question: can you execute run.py and get results correctly before?

trinanjan12 commented 3 years ago

Yes

LiuXinqi12 commented 2 years ago

@chenw191 Hi, I also encountered this problem. Did you solve it?

chenw191 commented 2 years ago

@chenw191 Hi, I also encountered this problem. Did you solve it?

No. Hope you can do this.

SalmaWafaa commented 1 year ago

Did you find a solution?? @chenw191 @LiuXinqi12