skhu101 / SHERF

Code for our ICCV'2023 paper "SHERF: Generalizable Human NeRF from a Single Image"
Other
302 stars 10 forks source link

SMPL model version #18

Closed Viki1314 closed 11 months ago

Viki1314 commented 12 months ago

Hi @skhu101 ,Thanks a lot for sharing this very excellent work ! I have a problem about the smpl model during evaluation.I downloaded and used the SMPL_NEUTRAL of version 1.1.0 for Python2.7 from https://smpl.is.tue.mpg.de/download.php.But this smpl model has 300 shape PCs which means the shape of parameter'shapedirs' is (6890,3,300) instead of (6890,3,10). SMPL_para This would be incredibly helpful ! Thanks a lot !

skhu101 commented 11 months ago

Hi, thanks for your interest in our work. The first 10 shape PCs should be used. If you have further questions, please let me know.

Viki1314 commented 11 months ago

Thanks for your help!!! I have solved this problem.

arnabdeypolimi commented 9 months ago

How did you solve the problem?

Viki1314 commented 9 months ago

How did you solve the problem?


import pickle
def smpl_pro():
model_paths = {
# 'neutral': os.path.join(model_dir, NEUTRAL_PATH)
# 'neutral': os.path.join(model_dir)
'neutral': os.path.join('assets/SMPL_NEUTRAL.pkl')
}
#import smpl        
with open(model_paths['neutral'], 'rb') as f:
smpl_model = pickle.load(f, encoding='latin1')
#reshape shapedirs
smpl_model['shapedirs'] = smpl_model["shapedirs"][:,:,:10]
#rewrite smpl
with open('smpl/assets/updated_data.pkl', 'wb') as f:
pickle.dump(smpl_model, f)
# with open(model_paths['neutral'], 'rb') as f:
#         smpl_model = pickle.load(f, encoding='latin1')
#check again
with open('smpl/assets/updated_data.pkl', 'rb') as f:
        smpl_model = pickle.load(f, encoding='latin1')
for key in smpl_model.keys():
    try:
        print(key,":",smpl_model[key].shape)
    except:
        print(key,":",smpl_model[key])