bharat-b7 / MultiGarmentNetwork

Repo for "Multi-Garment Net: Learning to Dress 3D People from Images, ICCV'19"
286 stars 65 forks source link

Wrong Prediction using MGN. #30

Closed Frank-Dz closed 4 years ago

Frank-Dz commented 4 years ago

To test the network, I construct my_testdata.pkl. my_testdata.pkl.zip

The data contains 8 images. And the person stands like this: image

Yet the output of test_network is wrong: image

Since the girl is in a T-shirt yet the network gives me a shirt.

I have set the garment type:

detected_garment1 = 'TShirtNoCoat'
detected_garment2 = 'Pants'
 TEMPLATE = pkl.load(open('assets/allTemplate_withBoundaries_symm.pkl', 'rb'), encoding='latin1')
  for n, gar in enumerate(TEMPLATE.keys()):
    if gar ==detected_garment1:
      print('current garment: ', gar)
      test_data["vertexlabel"][0][np.where(TEMPLATE[gar][1])[0]] = (n + 1)  # 0 is kept for skin

  for n, gar in enumerate(TEMPLATE.keys()):
    if gar == detected_garment2:
      print('current garment: ', gar)
      test_data["vertexlabel"][0][np.where(TEMPLATE[gar][1])[0]] = (n + 1)  # 0 is kept for skin

Anyone can help?

(To test the .pkl, when you read it in, just set

dat = pkl.load(open('assets/my_testdata.pkl', "rb"), encoding="latin1")  # added this encoding stuff for Python3
# dat = {k: v[config.train.batch_size:] for k, v in dat.items()}  # added this to slice the data

Thanks in advance!

bharat-b7 commented 4 years ago

It seems that you are supplying wrong vertexlablel. Ensure that test_data["vertexlabel"][0][<garment vertices>] contains 0s for all garments not present in the input image.

Frank-Dz commented 4 years ago

It seems that you are supplying wrong vertexlablel. Ensure that test_data["vertexlabel"][0][<garment vertices>] contains 0s for all garments not present in the input image.

OK! Thanks!

BTW, if it is possible to release the train code? Thanks again!

Best, Frank

neonb88 commented 4 years ago

@Frank-Dz Did you at least get the SMPL model to look like the girl in the image? I've been having trouble getting the right shape parameters "beta" from a modified version of test_network.py

Frank-Dz commented 4 years ago

@Frank-Dz Did you at least get the SMPL model to look like the girl in the image? I've been having trouble getting the right shape parameters "beta" from a modified version of test_network.py

Yep the shape seems right. I sent you an email. pls check.

neonb88 commented 4 years ago

BTW, if it is possible to release the train code?

Best, Frank

Look (grep) for def train in network/base_network.py. On my machine, it's line 431. Unfortunately I don't know details of how to use this yet. You can read BLB's paper. Hope that helps! :smile:

xiezhy6 commented 4 years ago

@Frank-Dz Hi, How do you get the "J_2d_x" in the testdata.pkl from the openpose estimated results?

Frank-Dz commented 4 years ago

You need to understand the meaning of the output of openpose then make them into json.

Best, Frank

On 08/9/2020 16:42,xiezhy6notifications@github.com wrote:

@Frank-Dz Hi, How do you get the "J_2d_x" in the testdata.pkl from the openpose estimated results?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

xiezhy6 commented 4 years ago

You need to understand the meaning of the output of openpose then make them into json. Best, Frank On 08/9/2020 16:42,xiezhy6notifications@github.com wrote: @Frank-Dz Hi, How do you get the "J_2d_x" in the testdata.pkl from the openpose estimated results? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

Thanks for your rely. I use the code mentioned in this comment to obtain the data for "J_2d_x". I think it work for me.