isarandi / metrabs

Estimate absolute 3D human poses from RGB images.

Home Page:https://arxiv.org/abs/2007.07227

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing files for converting models to PyTorch

Ending2015a opened this issue · comments

Hello, thank you for this nice work!
I want to convert the Tensorflow weights to PyTorch using convert_model_from_tf.py.
But it requires some additional files, which I cant find in this repo. Could you also provide these files?

load_path: /work/sarandi/rwth-data/experiments/kerasreprod/effv2s_bn16ss_huge8_3e-4_sep_1gpu_simplerand_1600k_finetune_48lchirnozero_regul_duallr_aegt_16000k/ckpt-160000.pt
joint_info_path: /work/sarandi/data/cache/huge8_joint_info.pkl

Hi, the Pytorch files can be directly downloaded. It's mentioned in the Readme. You don't have to build it yourself.

wget -O - https://bit.ly/metrabs_l_pt | tar -xzvf -
python -m metrabs_pytorch.scripts.demo_image --model-dir metrabs_eff2l_384px_800k_28ds_pytorch --image img/test_image_3dpw.jpg

You can replace l by s or s_256 in the URL. I'll make these things clearer in the docs when I get the time.

@isarandi.
Do you have the pytorch weights of this model metrabs_eff2m_y4?
I have tried metrabs_m_pt, metrabs_m_256_pt but can't download.

EfficientNet-M models were only trained earlier, on the 6-dataset combination. For the latest WACV'23 batch of models, I used only S and L variants due to compute resource constraints, and I've only prepared PyTorch releases for these.

@isarandi .
I think these cache files (skeleton_infos.pkl, joint_transform_matrix.npy, joint_info.npz) are also needed to run the pytorch demo scripts.
Where can I find these files?

Also when I run the script, I got this error message from posepile

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/posepile/paths.py", line 5, in <module>
    DATA_ROOT = os.environ['DATA_ROOT']
  File "/usr/lib/python3.8/os.py", line 675, in __getitem__
    raise KeyError(key) from None
KeyError: 'DATA_ROOT'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.8/dist-packages/posepile/util/__init__.py", line 2, in <module>
    from posepile.util.misc import *
  File "/usr/local/lib/python3.8/dist-packages/posepile/util/misc.py", line 6, in <module>
    from posepile.paths import DATA_ROOT
  File "/usr/local/lib/python3.8/dist-packages/posepile/paths.py", line 7, in <module>
    raise KeyError(
KeyError: 'The DATA_ROOT environment variable is not set. Set it to the parent dir of the dataset directories.'

How can I resolve this issue? Do I need to download the whole dataset for inference?

Probably you just need to set that environment variable. Most of the code expects DATA_ROOT to exist, even if empty.
All necessary files are packaged into the downloadable archive.