chaitanya100100 / TailorNet

Code for our CVPR 2020 (ORAL) paper - TailorNet: Predicting Clothing in 3D as a Function of Human Pose, Shape and Garment Style.
https://virtualhumans.mpi-inf.mpg.de/tailornet/
Other
408 stars 67 forks source link

How to combine up upper cloth and pants in detail? #44

Closed ranorzh closed 3 years ago

ranorzh commented 3 years ago

I have noticed the closed issue (here), but when I use visualize_two_garments_body function to replace visualize_garment_body in run_tailornet.py with:

visualize_two_garments_body(
      pred_gar, body, os.path.join(OUT_PATH, "img_{:04d}.png".format(i)),
lower_gc='skirt', upper_gc='t-shirt', side='front')

run python run_tailortnet.py render an error occurred:

Traceback (most recent call last):
  File "run_tailornet.py", line 143, in <module>
    render_images()
  File "run_tailornet.py", line 128, in render_images
    pred_gar, body, os.path.join(OUT_PATH, "img_{:04d}.png".format(i)), lower_gc='skirt', upper_gc='t-shirt', side='front')    
TypeError: visualize_two_garments_body() missing 1 required positional argument: 'outpath'

especially I have tried to use the function get_sequence_inputs, but this error still occurred. Could you tell me how to fix this problem? and what`s the pipeline of rendering two_garments? @chaitanya100100 Thanks!

chaitanya100100 commented 3 years ago

visualize_two_garments_body function takes these arguments: (lower, upper, body, outpath, lower_gc=None, upper_gc=None, side='front')

You have provided: (pred_gar, body, os.path.join(OUT_PATH, "img_{:04d}.png".format(i)), lower_gc='skirt', upper_gc='t-shirt', side='front')

You are providing only one garment. You need to provide upper and lower garment both.

ranorzh commented 3 years ago

visualize_two_garments_body function takes these arguments: (lower, upper, body, outpath, lower_gc=None, upper_gc=None, side='front')

You have provided: (pred_gar, body, os.path.join(OUT_PATH, "img_{:04d}.png".format(i)), lower_gc='skirt', upper_gc='t-shirt', side='front')

You are providing only one garment. You need to provide upper and lower garment both.

Thank you for your quick reply. but sorry, I don't understand how to specify upper and lower garment both in code/ run_tailornet funcion, the funtion thetas, betas, gammas = get_sequence_inputs(garment_class, gender) is used. I think there is still some code that needs to be changed. Hope to have further answers >_<

chaitanya100100 commented 3 years ago

As mentioned in this(https://github.com/chaitanya100100/TailorNet/issues/3#issuecomment-663016576) issue, this repo is for TailorNet training only. Visualization code is just for reference.

If you dive into the code and understand the routines, it will be very easy to modify the code to support your usecase. You just have to load two tailornet models for upper and lower garment, predict both garments from input and call visualize_two_garments_body with the output meshes. OR you can just run code twice (one with upper and one with lower) and save your results. And then write a seperate routine to visualize those saved results.