MCPcopy Create free account
hub / github.com/MotrixLab/AiOS / process_human_model_output_batch_ubody

Function process_human_model_output_batch_ubody

util/preprocessing.py:484–689  ·  view source on GitHub ↗
(human_model_param,
                                     do_flip,
                                     rot,
                                     as_smplx,
                                     part_valid
                                     )

Source from the content-addressed store, hash-verified

482
483
484def process_human_model_output_batch_ubody(human_model_param,
485 do_flip,
486 rot,
487 as_smplx,
488 part_valid
489 ):
490 num_person = human_model_param['body_pose'].shape[0]
491 human_model = smpl_x
492 rotation_valid = np.ones((num_person,smpl_x.orig_joint_num), dtype=np.float32)
493 coord_valid = np.ones((num_person,smpl_x.joint_num), dtype=np.float32)
494 # expr_valid = np.ones((num_person), dtype=np.float32)
495 # shape_valid = np.ones((num_person), dtype=np.float32)
496 # root_pose, body_pose, shape, trans = human_model_param['root_pose'], human_model_param['body_pose'], \
497 # human_model_param['shape'], human_model_param['trans']
498
499 if 'smplx_valid' in human_model_param:
500 smplx_valid = human_model_param['smplx_valid']
501 shape_valid = human_model_param['smplx_valid']
502 else:
503 smplx_valid = np.ones(num_person, dtype=np.bool8)
504 shape_valid = np.ones(num_person, dtype=np.bool8)
505
506 if 'expr_valid' in human_model_param:
507 expr_valid = human_model_param['expr_valid']
508 else:
509 expr_valid = np.ones(num_person, dtype=np.bool8)
510 expr_valid*=smplx_valid
511
512 if 'face_valid' in human_model_param:
513 face_valid = human_model_param['face_valid']
514 else:
515 face_valid = np.ones(num_person, dtype=np.bool8)
516 face_valid *= smplx_valid
517
518 # check lhand valid key exsits
519 if 'lhand_valid' in human_model_param:
520 lhand_valid = human_model_param['lhand_valid']
521 else:
522 lhand_valid = np.ones(num_person, dtype=np.bool8)
523 lhand_valid*=smplx_valid
524
525 # check rhand valid key exsits
526 if 'rhand_valid' in human_model_param:
527 rhand_valid = human_model_param['rhand_valid']
528 else:
529 rhand_valid = np.ones(num_person, dtype=np.bool8)
530 rhand_valid*=smplx_valid
531
532 # check validation of the smplx parameters
533 if 'body_pose' in human_model_param \
534 and human_model_param['body_pose'] is not None:
535 root_pose, body_pose = human_model_param['root_pose'], human_model_param['body_pose']
536 shape, trans = human_model_param['shape'], human_model_param['trans']
537 root_pose = torch.FloatTensor(root_pose).view(num_person, 1, 3)
538 body_pose = torch.FloatTensor(body_pose).view(num_person, -1, 3)
539 shape = torch.FloatTensor(shape).view(num_person, -1)
540 trans = torch.FloatTensor(trans).view(num_person,-1)
541 else:

Callers 1

__getitem__Method · 0.90

Calls 2

cloneMethod · 0.80
copyMethod · 0.80

Tested by

no test coverage detected