face-api.js icon indicating copy to clipboard operation
face-api.js copied to clipboard

no face descriptions in some lighting conditions

Open foolhardy21 opened this issue 1 year ago • 1 comments

  • 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 the faceDescriptions array accurately. Any solutions/fixes for this case ?
  • 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;
}

foolhardy21 avatar May 05 '23 05:05 foolhardy21

Even i was also facing the same issue. @foolhardy21 did you get any solution to overcome this?

chaitanya71998 avatar Dec 06 '23 11:12 chaitanya71998