I need to customize the pointColor and lineColor in my code, but I'm not sure how to do it. I am using the fast-api.js library and haven't come across any examples of customized Landmarks Styles.
export const drawResults = async (image, canvas, results, type) => {
if (image && canvas && results) {
const imgSize = image.getBoundingClientRect();
const displaySize = { width: imgSize.width, height: imgSize.height };
faceapi.matchDimensions(canvas, displaySize);
canvas.getContext('2d').clearRect(0, 0, canvas.width, canvas.height);
const resizedDetections = faceapi.resizeResults(results, displaySize);
switch (type) {
case 'landmarks':
faceapi.draw.drawFaceLandmarks(canvas, resizedDetections);
break;
case 'expressions':
faceapi.draw.drawFaceExpressions(canvas, resizedDetections);
break;
case 'box':
faceapi.draw.drawDetections(canvas, resizedDetections);
break;
case 'boxLandmarks':
faceapi.draw.drawDetections(canvas, resizedDetections);
faceapi.draw.drawFaceExpressions(canvas, resizedDetections);
faceapi.draw.drawFaceLandmarks(canvas, resizedDetections);
break;
default:
break;
}
}
};