import pyrender import trimesh if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('--pkl', nargs='+', type=str, required=True, help='The pkl files that will be read') args, remaining = parser.parse_known_args() pkl_paths = args.pkl args = parse_config(remaining) dtype = torch.float32 use_cuda = args.get('use_cuda', True) if use_cuda and torch.cuda.is_available(): device = torch.device('cuda') else: device = torch.device('cpu') print(args.get('model_folder')) model_params = dict( model_path=args.get('model_folder'), # joint_mapper=joint_mapper, create_global_orient=True, create_body_pose=not args.get('use_vposer'), create_betas=True, create_left_hand_pose=True,
data['keypoints'] = keyps print('Processing: {}'.format(data['img_path'])) # init guess if setting['seq_start'] or not args.get('is_seq'): init_guess(setting, data, use_torso=True, **args) else: load_init(setting, data, results, use_torso=True, **args) fix_params(setting, scale=setting['fixed_scale'], shape=setting['fixed_shape']) # linear solve print("linear solve, to do...") # non-linear solve results = non_linear_solver(setting, data, **args) # save results save_results(setting, data, results, **args) elapsed = time.time() - start time_msg = time.strftime('%H hours, %M minutes, %S seconds', time.gmtime(elapsed)) print('Processing the data took: {}'.format(time_msg)) if __name__ == "__main__": sys.argv = ["", "--config=cfg_files\\fit_smpl.yaml"] args = parse_config() main(**args)
expr_prior=expr_prior, body_pose_prior=body_pose_prior, left_hand_prior=left_hand_prior, right_hand_prior=right_hand_prior, jaw_prior=jaw_prior, angle_prior=angle_prior, **args) elapsed = time.time() - start time_msg = time.strftime('%H hours, %M minutes, %S seconds', time.gmtime(elapsed)) print('Processing the data took: {}'.format(time_msg)) if __name__ == "__main__": DATA_FOLDER = "/media/psf/WVerbatim/data/mevolve/smplify-x/prox-data" OUTPUT_FOLDER = DATA_FOLDER + "/output" MODEL_FOLDER = "/media/psf/WVerbatim/data/mevolve/smplify-x/models" VPOSER_FOLDER = "/media/psf/WVerbatim/data/mevolve/smplify-x/vposer_v1_0" import sys argv = [ "--config", SCRIPT_PATH + "/../cfg_files/fit_smpl.yaml", "--use_cuda", "0", "--interpenetration", "0", "--visualize", "0", "--interactive", "0", "--data_folder", DATA_FOLDER, "--output_folder", OUTPUT_FOLDER, "--visualize", "True", "--model_folder", MODEL_FOLDER, "--vposer_ckpt", VPOSER_FOLDER, "--gender", "male" ] # argv=None args = parse_config(argv) main(**args)