MCPcopy Create free account
hub / github.com/MotrixLab/ADHMR / load_model

Function load_model

ADHMR/lib/utils/function.py:208–214  ·  view source on GitHub ↗
(model,state)

Source from the content-addressed store, hash-verified

206 return model, model_cond, ema_helper, ema_helper_cond, optimizer_hyponet, optimizer_hrnet, start_epoch, step, loss, min_mpjpe_h36m, min_mpjpe_pw3d
207
208def load_model(model,state):
209 state_model = model.state_dict()
210 for key in state_model.keys():
211 if key in state.keys() and state_model[key].shape == state[key].shape:
212 state_model[key] = state[key]
213 model.load_state_dict(state_model)
214 return model
215
216def get_model_score(config, is_train = True, resume = False, resume_path = None):
217 neighbour_matrix = get_neighbour_matrix_from_hand(parents,childrens,num_joints=config.hyponet.num_joints,num_edges=config.hyponet.num_twists,knn=config.scorenet.knn)

Callers 1

get_model_scoreFunction · 0.70

Calls 3

state_dictMethod · 0.45
keysMethod · 0.45
load_state_dictMethod · 0.45

Tested by

no test coverage detected