i added an option to use png face mask with transparency for the faceswap demo. this is useful when the mask contour exceeds the actual face and includes some of the background. in this case, allowing a transparent background in the mask allows a much cleaner effect. i changed in https://github.com/eyaler/tfjs_webgl_app/blob/master/face_landmark/render_facemesh.js#L32
void main(void)
{
vec4 color;
color = vec4(texture2D(u_sampler, v_texcoord));
color[0] *= u_color[0];
color[1] *= u_color[1];
color[2] *= u_color[2];
color[3] *= v_vtxalpha * u_alpha;
gl_FragColor = color;
}
i added an option to use png face mask with transparency for the faceswap demo. this is useful when the mask contour exceeds the actual face and includes some of the background. in this case, allowing a transparent background in the mask allows a much cleaner effect. i changed in https://github.com/eyaler/tfjs_webgl_app/blob/master/face_landmark/render_facemesh.js#L32
you can see it in work in my fork for offline videos: https://eyaler.github.io/tfjs_webgl_app/face_landmark
thanks for your awesome work! i learnt a lot from you!