MCPcopy Index your code
hub / github.com/MotrixLab/MotionDiffuse / build_models

Function build_models

text2motion/datasets/evaluator.py:354–373  ·  view source on GitHub ↗
(opt)

Source from the content-addressed store, hash-verified

352
353
354def build_models(opt):
355 movement_enc = MovementConvEncoder(opt.dim_pose-4, opt.dim_movement_enc_hidden, opt.dim_movement_latent)
356 text_enc = TextEncoderBiGRUCo(word_size=opt.dim_word,
357 pos_size=opt.dim_pos_ohot,
358 hidden_size=opt.dim_text_hidden,
359 output_size=opt.dim_coemb_hidden,
360 device=opt.device)
361
362 motion_enc = MotionEncoderBiGRUCo(input_size=opt.dim_movement_latent,
363 hidden_size=opt.dim_motion_hidden,
364 output_size=opt.dim_coemb_hidden,
365 device=opt.device)
366
367 checkpoint = torch.load(pjoin('data/pretrained_models', opt.dataset_name, 'text_mot_match', 'model', 'finest.tar'),
368 map_location=opt.device)
369 movement_enc.load_state_dict(checkpoint['movement_encoder'])
370 text_enc.load_state_dict(checkpoint['text_encoder'])
371 motion_enc.load_state_dict(checkpoint['motion_encoder'])
372 print('Loading Evaluation Model Wrapper (Epoch %d) Completed!!' % (checkpoint['epoch']))
373 return text_enc, motion_enc, movement_enc
374
375
376class EvaluatorModelWrapper(object):

Callers 1

__init__Method · 0.70

Calls 4

MovementConvEncoderClass · 0.85
TextEncoderBiGRUCoClass · 0.85
loadMethod · 0.80

Tested by

no test coverage detected