INNER CODE UNIT · Python

frequency

TimoBolkart/voca · edit_sequences.py:94

    frequency = num_frames // (num_blinks+1)
    weights = np.zeros(num_frames)
    for i in range(num_blinks):
        x1 = (i+1)*frequency-blink_duration//2
        x2 = x1+3*step
        if x1 >= 0 and x2 < weights.shape[0]:
            weights[x1:x2] = blink_weights

    predicted_vertices = np.zeros((num_frames, model.v_template.shape[0], model.v_template.shape[1]))

    for frame_idx in range(num_frames):
        model.v_template[:] = Mesh(filename=sequence_fnames[frame_idx]).v
        model.betas[300:] = weights[frame_idx]*blink_exp_betas
        predicted_vertices[frame_idx] = model.r

    output_sequence_meshes(predicted_vertices, Mesh(model.v_template, model.f), out_path, uv_template_fname=uv_template_fname, texture_img_fname=texture_img_fname)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…