vchoutas / smplx

SMPL-X
https://smpl-x.is.tue.mpg.de/
Other
1.89k stars 315 forks source link

npz files missing for SMPL-H model #10

Closed monajalal closed 4 years ago

monajalal commented 5 years ago

Could you please share the npz files for SMPL-H model?

I get the following error:

[jalal@goku smplx]$ python examples/demo.py --model-folder /scratch3/3d_pose/humanpose/SMPL_models/models --model-type="smplh" --plot-joints=True --gender="female" --use-face-contour=True
Traceback (most recent call last):
  File "examples/demo.py", line 138, in <module>
    use_face_contour=use_face_contour)
  File "examples/demo.py", line 33, in main
    ext=ext)
  File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/smplx/body_models.py", line 99, in create
    return SMPLH(model_path, **kwargs)
  File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/smplx/body_models.py", line 468, in __init__
    smplh_path)
AssertionError: Path /scratch3/3d_pose/humanpose/SMPL_models/models/smplh/SMPLH_FEMALE.npz does not exist!
[jalal@goku smplx]$ ls /scratch3/3d_pose/humanpose/SMPL_models/models/smplh/
total 254740
drwxrwx---. 4 jalal cs-grad      4096 Sep 24 17:33 ..
-rwx------. 1 jalal cs-grad 130422893 Sep 24 17:33 SMPLH_male.pkl
drwxr-xr-x. 2 jalal cs-grad        64 Sep 24 17:34 .
-rwx------. 1 jalal cs-grad 130423021 Sep 24 17:34 SMPLH_female.pkl
dimtzionas commented 5 years ago

For legacy reasons, the original PKL files need to be converted to NPZ. The procedure is described in the read_me file here: https://github.com/vchoutas/smplx#downloading-the-model

It will point you to the converting script, that is here: https://github.com/vchoutas/smplx/blob/master/tools/README.md

monajalal commented 5 years ago

@dimtziwnas I have done the conversion to MANO however, for converting the smplh pkl files to npz files, what script do you use? I found this https://github.com/VUmcCGP/wisecondor/issues/33#issuecomment-320912217 but seems might not be correct always.

monajalal commented 5 years ago

so I untarred the smplh.tar.xz from SMPLH website. and in the female folder it had model.npz and I renamed it to SMPLH_FEMALE.npz, after using it I get this error:

[jalal@goku smplx]$ python examples/demo.py --model-folder /scratch3/3d_pose/humanpose/SMPL_models/models --model-type="smplh" --plot-joints=True --gender="female" --use-face-contour=True
Traceback (most recent call last):
  File "examples/demo.py", line 138, in <module>
    use_face_contour=use_face_contour)
  File "examples/demo.py", line 33, in main
    ext=ext)
  File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/smplx/body_models.py", line 99, in create
    return SMPLH(model_path, **kwargs)
  File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/smplx/body_models.py", line 491, in __init__
    left_hand_components = data_struct.hands_componentsl[:num_pca_comps]
AttributeError: 'Struct' object has no attribute 'hands_componentsl'

This is what I have:

[jalal@goku smplh]$ pwd
/scratch3/3d_pose/humanpose/SMPL_models/models/smplh
[jalal@goku smplh]$ ls
total 712520
drwxrwx---. 5 jalal cs-grad      4096 Sep 24 19:14 ..
-rw-r--r--. 1 jalal cs-grad 277831513 Sep 24 20:10 SMPLH_female.pkl
-rw-r--r--. 1 jalal cs-grad 277258665 Sep 24 20:10 SMPLH_male.pkl
-rw-r--r--. 1 jalal cs-grad  87259106 Sep 24 20:37 SMPLH_FEMALE.npz
-rw-r--r--. 1 jalal cs-grad  87259106 Sep 24 20:37 SMPLH_MALE.npz
drwxr-xr-x. 2 jalal cs-grad       118 Sep 24 20:38 .

and

[jalal@goku models]$ tree .
.
├── __init__.py
├── smpl
│   ├── SMPL_FEMALE.npz
│   ├── SMPL_FEMALE.pkl
│   ├── SMPL_MALE.npz
│   ├── SMPL_MALE.pkl
│   └── SMPL_NEUTRAL.npz
├── smplh
│   ├── SMPLH_FEMALE.npz
│   ├── SMPLH_MALE.npz
│   ├── SMPLH_female.pkl
│   └── SMPLH_male.pkl
└── smplx
    ├── SMPLX_FEMALE.npz
    ├── SMPLX_FEMALE.pkl
    ├── SMPLX_MALE.npz
    ├── SMPLX_MALE.pkl
    ├── SMPLX_NEUTRAL.npz
    ├── SMPLX_NEUTRAL.pkl
    └── version.txt

3 directories, 17 files
dimtzionas commented 5 years ago

Did you download the version that says "for AMASS"? (special version of ICCV'19 work)

If yes, please download by clicking on "Models & code" and repeat. This link will give you the original SIGA'17 PKL files, which are the ones that you should be using.

monajalal commented 5 years ago

ok so I deleted everything and only downloaded "Models & code" zip file. When I extract it, there is no .NPZ file. Could you please email me the npz files or tell me what script do you use to create them?

[jalal@goku SMPLH-fix]$ unzip mano_v1_2.zip 
Archive:  mano_v1_2.zip
   creating: mano_v1_2/
  inflating: mano_v1_2/.DS_Store     
  inflating: mano_v1_2/._.DS_Store   
  inflating: mano_v1_2/LICENSE.txt   
  inflating: mano_v1_2/__init__.py   
   creating: mano_v1_2/models/
  inflating: mano_v1_2/models/LICENSE.txt  
  inflating: mano_v1_2/models/MANO_LEFT.pkl  
  inflating: mano_v1_2/models/MANO_RIGHT.pkl  
  inflating: mano_v1_2/models/SMPLH_female.pkl  
  inflating: mano_v1_2/models/SMPLH_male.pkl  
  inflating: mano_v1_2/models/info.txt  
   creating: mano_v1_2/webuser/
  inflating: mano_v1_2/webuser/LICENSE.txt  
  inflating: mano_v1_2/webuser/README.txt  
  inflating: mano_v1_2/webuser/__init__.py  
   creating: mano_v1_2/webuser/hello_world/
  inflating: mano_v1_2/webuser/hello_world/MANO___hello_world.py  
  inflating: mano_v1_2/webuser/hello_world/MANO___render.py  
  inflating: mano_v1_2/webuser/hello_world/SMPL+H___hello_world.py  
  inflating: mano_v1_2/webuser/hello_world/SMPL+H___render.py  
  inflating: mano_v1_2/webuser/lbs.py  
  inflating: mano_v1_2/webuser/posemapper.py  
  inflating: mano_v1_2/webuser/serialization.py  
  inflating: mano_v1_2/webuser/smpl_handpca_wrapper.py  
  inflating: mano_v1_2/webuser/smpl_handpca_wrapper_HAND_only.py  
  inflating: mano_v1_2/webuser/verts.py  
[jalal@goku SMPLH-fix]$ ls mano_v1_2/models/
total 262212
-rwx------. 1 jalal cs-grad 130422893 Nov 22  2017 SMPLH_male.pkl
-rwx------. 1 jalal cs-grad 130423021 Nov 22  2017 SMPLH_female.pkl
-rwx------. 1 jalal cs-grad        95 Nov 22  2017 info.txt
-rwx------. 1 jalal cs-grad      4330 Nov 26  2017 LICENSE.txt
-rwx------. 1 jalal cs-grad   3821356 May 14  2018 MANO_RIGHT.pkl
-rwx------. 1 jalal cs-grad   3821391 May 14  2018 MANO_LEFT.pkl
drwx------. 4 jalal cs-grad       137 Jan 17  2019 ..
drwxr-xr-x. 2 jalal cs-grad       158 Jan 17  2019 .

I downloaded the link that is in blue now. Screenshot from 2019-09-25 13-40-36

am I not supposed to use the .npz files in the .tar.xz file for AMASS?

[jalal@goku ICCV19]$ pwd
/scratch3/3d_pose/humanpose/SMPL_models/SMPLH-fix/ICCV19
[jalal@goku ICCV19]$ ls
total 110592
-rwx------. 1 jalal cs-grad      4330 Nov 26  2017 LICENSE.txt
-rwx------. 1 jalal cs-grad       305 Aug 12 10:23 info.txt
drwxr-x---. 2 jalal cs-grad        31 Aug 12 12:38 female
drwxr-x---. 2 jalal cs-grad        31 Aug 12 12:38 male
drwxr-x---. 2 jalal cs-grad        31 Aug 12 12:38 neutral
drwxr-xr-x. 4 jalal cs-grad        74 Sep 25 13:42 ..
-rw-r--r--. 1 jalal cs-grad 113231292 Sep 25 13:42 smplh.tar.xz
drwxr-xr-x. 5 jalal cs-grad       130 Sep 25 13:43 .
[jalal@goku ICCV19]$ ls female/
total 85216
-rw-r--r--. 1 jalal cs-grad 87259106 Aug 12 10:09 model.npz
drwxr-x---. 2 jalal cs-grad       31 Aug 12 12:38 .
drwxr-xr-x. 5 jalal cs-grad      130 Sep 25 13:43 ..
dimtzionas commented 5 years ago

You downloaded the right thing, now you have the PKL files :)

As pointed above, now you need to run the converting script, to turn these PKL files into NPZ: https://github.com/vchoutas/smplx/blob/master/tools/README.md

JanaldoChen commented 4 years ago

@monajalal I meet the problem too, when I use the smplh. But I add the --ext pkl, it's OK now. For example: python examples/demo.py --model-folder $SMPLH_FOLDER --model-type smplh --ext pkl --gender female --plot-joints True

22036435 commented 2 months ago

Hi I need joints_mat_SMPLH.pkl file to be converted into npz file how can I do it?