Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors on Linux (Ubuntu) when running quickstart example #28

Closed
FrankSpalteholz opened this issue Jun 9, 2021 · 10 comments
Closed

Errors on Linux (Ubuntu) when running quickstart example #28

FrankSpalteholz opened this issue Jun 9, 2021 · 10 comments

Comments

@FrankSpalteholz
Copy link

First of all thank you very much for this great repo! When trying the quick-start example i'm facing some errors where i'd really appreciate some help:

  1. After processing the videos:

Traceback (most recent call last):
File "scripts/preprocess/extract_video.py", line 267, in
join(args.path, 'openpose_render', sub), args)
File "scripts/preprocess/extract_video.py", line 56, in extract_2d
os.chdir(openpose)
FileNotFoundError: [Errno 2] No such file or directory: '/media/qing/Project/openpose'

  1. After triangulation:

-> [Optimize global RT ]: 0.9ms
Traceback (most recent call last):
File "apps/demo/mv1p.py", line 109, in
mv1pmf_smpl(dataset, args)
File "apps/demo/mv1p.py", line 71, in mv1pmf_smpl
weight_shape=weight_shape, weight_pose=weight_pose)
File "/home/frankfurt/dev/EasyMocap/easymocap/pipeline/basic.py", line 77, in smpl_from_keypoints3d2d
params = multi_stage_optimize(body_model, params, kp3ds, kp2ds, bboxes, Pall, weight_pose, cfg)
File "/home/frankfurt/dev/EasyMocap/easymocap/pipeline/basic.py", line 18, in multi_stage_optimize
params = optimizePose3D(body_model, params, kp3ds, weight=weight, cfg=cfg)
File "/home/frankfurt/dev/EasyMocap/easymocap/pyfitting/optimize_simple.py", line 301, in optimizePose3D
params = _optimizeSMPL(body_model, params, prepare_funcs, postprocess_funcs, loss_funcs, weight_loss=weight, cfg=cfg)
File "/home/frankfurt/dev/EasyMocap/easymocap/pyfitting/optimize_simple.py", line 246, in _optimizeSMPL
final_loss = fitting.run_fitting(optimizer, closure, opt_params)
File "/home/frankfurt/dev/EasyMocap/easymocap/pyfitting/optimize.py", line 38, in run_fitting
loss = optimizer.step(closure)
File "/home/frankfurt/dev/EasyMocap/easymocap/pyfitting/lbfgs.py", line 307, in step
orig_loss = closure()
File "/home/frankfurt/dev/EasyMocap/easymocap/pyfitting/optimize_simple.py", line 227, in closure
new_params = func(new_params)
File "/home/frankfurt/dev/EasyMocap/easymocap/pyfitting/optimize_simple.py", line 121, in interp_func
params[key][nf] = interp(params[key][left], params[key][right], 1-weight, key=key)
IndexError: index 800 is out of bounds for dimension 0 with size 800

Then triangulation runs a second time:
(with same error like above) and this one:

Traceback (most recent call last):
File "apps/demo/mv1p.py", line 108, in
mv1pmf_skel(dataset, check_repro=True, args=args)
File "apps/demo/mv1p.py", line 35, in mv1pmf_skel
images, annots = dataset[nf]
File "/home/frankfurt/dev/EasyMocap/easymocap/dataset/mv1pmf.py", line 73, in getitem
annots = self.select_person(annots_all, index, self.pid)
File "/home/frankfurt/dev/EasyMocap/easymocap/dataset/base.py", line 461, in select_person
keypoints = np.zeros((self.config['nJoints'], 3))
KeyError: 'nJoints'

Thank you very much!

@chingswy
Copy link
Contributor

chingswy commented Jun 9, 2021

1. After processing the videos:

Did you run this script on zju-ls-feng.zip?
If not, you should install and specify the path by --openpose <openpose_path>.
If so, it doesn't need run OpenPose. Can you show me the folder structure?

@FrankSpalteholz
Copy link
Author

FrankSpalteholz commented Jun 9, 2021

Hi Quing, and thank you for the fast reply. Although you were right (haven't copied the openpose-folder to my testdata-folder) it gives me the same error. here is my folder structure:

Screenshot from 2021-06-09 13-36-35

I'm refering to "mocap_output" as out-folder and "testData" as data-folder.
There is one more thing ... you are mentioning to install 3 smpl-files which are named like "SMPL_FEMALE.pkl" (also for NEUTRAL and MALE) but i've checked all possible downloads on the website "http://smpl.is.tue.mpg.de" but none of them were containing those files. The ones I've found though were inside of "SMPL_python_v.1.1.0.zip" under "models" but their names were different:
basicmodel_f_lbs_10_207_0_v1.1.0.pkl, basicmodel_m_lbs_10_207_0_v1.1.0.pkl and basicmodel_neutral_lbs_10_207_0_v1.1.0.pkl. So although you haven't mentioned so i assumed to just rename them. Maybe that's also causing issues?
Thank you again!

@chingswy
Copy link
Contributor

chingswy commented Jun 9, 2021

Download the data with annotation here and extract it. Then run:

data=<path/to/zju-ls-feng-annot>
python3 scripts/preprocess/extract_video.py ${data} --no2d
python3 apps/demo/mv1p.py ${data} --out ${data}/output/smpl --undis --vis_smpl

@FrankSpalteholz
Copy link
Author

FrankSpalteholz commented Jun 9, 2021

Thanks again. After following your advice and run the script i got this one:

cameras: 1 10 11 12 13 14 15 16 17 18 19 2 20 21 22 23 3 4 5 6 7 8 9

Demo code for multiple views and one person:

- Input : /home/frankfurt/dev/EasyMocap/data/testData => 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23
- Output: /home/frankfurt/dev/EasyMocap/data/testData/output/smpl
- Body  : smpl=>neutral, body25

triangulation: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 800/800 [00:04<00:00, 175.61it/s]
dump: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 800/800 [00:00<00:00, 8895.38it/s]
loading: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 800/800 [00:03<00:00, 212.35it/s]
Traceback (most recent call last):
File "apps/demo/mv1p.py", line 109, in
mv1pmf_smpl(dataset, args)
File "apps/demo/mv1p.py", line 68, in mv1pmf_smpl
body_model = load_model(gender=args.gender, model_type=args.model)
File "/home/frankfurt/dev/EasyMocap/easymocap/smplmodel/body_param.py", line 50, in load_model
regressor_path=reg_path)
File "/home/frankfurt/dev/EasyMocap/easymocap/smplmodel/body_model.py", line 64, in init
self.faces = data['f']
KeyError: 'f'

Edit: i also downloaded the smpl-models for python 1.0.0. But again: they are having different names so i renamed them following your naming-convention. That was correct ... right?

@chingswy
Copy link
Contributor

chingswy commented Jun 9, 2021

Can you print data.keys() before this line?

"easymocap/smplmodel/body_model.py", line 64,

@FrankSpalteholz
Copy link
Author

FrankSpalteholz commented Jun 9, 2021

loading: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 800/800 [00:15<00:00, 52.62it/s]
-> dict_keys(['cam_t', 'poses', 'betas', 'focal_length'])
Traceback (most recent call last):
File "apps/demo/mv1p.py", line 109, in
mv1pmf_smpl(dataset, args)
File "apps/demo/mv1p.py", line 68, in mv1pmf_smpl
body_model = load_model(gender=args.gender, model_type=args.model)
File "/home/frankfurt/dev/EasyMocap/easymocap/smplmodel/body_param.py", line 50, in load_model
regressor_path=reg_path)
File "/home/frankfurt/dev/EasyMocap/easymocap/smplmodel/body_model.py", line 65, in init
self.faces = data['f']
KeyError: 'f'

indicated print(data.keys()) with "->" above

@chingswy
Copy link
Contributor

It's obvious that you used a wrong SMPL model. Please check it.

@FrankSpalteholz
Copy link
Author

FrankSpalteholz commented Jun 10, 2021

Thanks but i already wrote that you are using SMPL_FEMALE.pkl (also for NEUTRAL and MALE) but on the website you've mentioned there are no such models available with these names. I was downloading SMPL_python_v.1.0.0.zip (containing basicmodel_m_lbs_10_207_0_v1.0.0.pkl and basicModel_f_lbs_10_207_0_v1.0.0.pkl) and mpips-smplify_public_v2.zip (containing basicModel_neutral_lbs_10_207_0_v1.0.0.pkl) These are the ones i'm using (i've renamed them to SMPL_FEMALE.pkl etc to follow your naming-convention) but if these are not the correct ones where can i find them?
Thank you so much again for your help

@chingswy
Copy link
Contributor

To check your model, run this:

import pickle
with open('basicmodel_m_lbs_10_207_0_v1.0.0.pkl', 'rb') as f:
    model = pickle.load(f, encoding='latin1') 
    print(model.keys())

The output of mine is:

dict_keys(['J_regressor_prior', 'f', 'J_regressor', 'kintree_table', 'J', 'weights_prior', 'weights', 'vert_sym_idxs', 'posedirs', 'pose_training_info', 'bs_style', 'v_template', 'shapedirs', 'bs_type'])

You can set other gender when running the demo code:

python3 apps/demo/mv1p.py ${data} --out ${data}/output/smpl --undis --vis_smpl --gender male
python3 apps/demo/mv1p.py ${data} --out ${data}/output/smpl --undis --vis_smpl --gender female

@FrankSpalteholz
Copy link
Author

Excellent ... my bad (of course) Thanks a lot for having so much patience with me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants