face-api.js
face-api.js copied to clipboard
no face descriptions in some lighting conditions
-
Problem statement
- If in the image there is a light source in the background or background is somewhat bright relative to foreground, then the
faceDescriptions
array is empty. If I use flash light for the foreground (person's face), then it gives thefaceDescriptions
array accurately. Any solutions/fixes for this case ?
- If in the image there is a light source in the background or background is somewhat bright relative to foreground, then the
-
The code is same in both the cases mentioned above.
-
Code
import { detectAllFaces } from 'face-api.js';
const currentImg = createImgHTML(imgSrc);
let faceDescriptions = await detectAllFaces(currentImg).withFaceLandmarks().withFaceDescriptors();
console.log("HERE", faceDescriptions)
export function createImgHTML(src) {
const imgHTMLElement = document.createElement('img');
imgHTMLElement.src = src;
imgHTMLElement.style.height = '30px';
imgHTMLElement.style.width = '50px';
return imgHTMLElement;
}
Even i was also facing the same issue. @foolhardy21 did you get any solution to overcome this?