예제 #1
0
def get_embedding_with_new_attribute_value(parameter_name:str, latents: np.ndarray, confignet_model: ConfigNet) -> np.ndarray:
    '''Samples a new value of the currently controlled face attribute and sets in the latent embedding'''

    new_param_value = confignet_model.facemodel_param_distributions[parameter_name].sample(1)[0]
    modified_latents = confignet_model.set_facemodel_param_in_latents(latents, parameter_name, new_param_value)

    return modified_latents
예제 #2
0
def set_gaze_direction_in_embedding(latents: np.ndarray, eye_pose: np.ndarray, confignet_model: ConfigNet) -> np.ndarray:
    '''Sets the selected eye pose in the specified latent variables
       This is accomplished by passing the eye pose through the synthetic data encoder
       and setting the corresponding part of the latent vector.
    '''
    latents = confignet_model.set_facemodel_param_in_latents(latents, "bone_rotations:left_eye", eye_pose)
    return latents