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

Fitting SMPL #11

Closed
kfarivar opened this issue Nov 16, 2020 · 1 comment
Closed

Fitting SMPL #11

kfarivar opened this issue Nov 16, 2020 · 1 comment

Comments

@kfarivar
Copy link

Hi

I have tried running the :

python smpl_registration/fit_SMPL_IPNet.py <scan_path.obj> <scan_labels.npy> <scale_file.npy> <save_path>

but I get the following error:

Traceback (most recent call last):
  File "smpl_registration/fit_SMPL_IPNet.py", line 381, in <module>
    _, _, _ = fit_SMPL([args.inner_path], scan_labels=[args.inner_labels], display=args.display, save_path=args.save_path,
  File "smpl_registration/fit_SMPL_IPNet.py", line 212, in fit_SMPL
    smpl_faces = sp.get_faces()
  File "/home/logi/Desktop/ipnet/IPNet/lib/smpl_paths.py", line 111, in get_faces
    return np.load(fname)
  File "/home/logi/anaconda3/envs/ipnet/lib/python3.8/site-packages/numpy/lib/npyio.py", line 416, in load
    fid = stack.enter_context(open(os_fspath(file), "rb"))
FileNotFoundError: [Errno 2] No such file or directory: '/BS/RVH/work/data/template/faces.npy'

So my question is:

Do I need to download the smpl models from the paper's website ? if yes where should I put them ?

Also what should the faces.npy file look like ? and how can I get it ?

@kfarivar
Copy link
Author

kfarivar commented Nov 18, 2020

I downloaded the smpl models from their website (v1.1) and put them in: IPNet/smplpytorch/smplpytorch/native/models/. you also need to rename the models to male_model.pkl and female_model.pkl

So for the faces I just made an SMPL model and got the faces from it like this (in the smpl_paths.py):

@staticmethod
    def get_faces():
        from lib.smpl_layer import SMPL_Layer
        model = SMPL_Layer(center_idx=0, gender='male', model_root='smplpytorch/smplpytorch/native/models')
        return model.th_faces.numpy()

I needed to change many absolute paths that were hardcoded to the correct ones to make it work. I suggest running the fitting script and correcting them according to the errors you get.

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

1 participant