justadudewhohacks/face-api.js

"Blob is not defined" fetching local images

Ouverte

#194 ouverte le 15 janv. 2019

 (10 commentaires) (0 réaction) (0 personne assignée)TypeScript (3 649 forks)batch import
enhancementgood first issuehelp wanted

Métriques du dépôt

Stars
 (15 839 étoiles)
Métriques de merge PR
 (Métriques PR en attente)

Description

Hi, i testing face-api.js and trying loading a local image for make face similarity and is throw me "Blob is not defined" in my nodeJS application, here the function where i try computing descriptors:

face.env.monkeyPatch({ fetch, Blob });

const threshold = 0.6;
var descriptors = { desc1: null, desc2: null };

function computarDescriptor(aDesc, aUri) {
  // ~statics/pics/001_tmp.jpg
  face.fetchImage(aUri).then(function(result) {
    console.log('fecthImage: ' + result);
    descriptors['desc' + aDesc] = face.computeFaceDescriptor(result);
  }).catch(err => {
    console.log(err);
  })
}

node-fetch and blob is installed and monkeyPatched and referenceErros is still there.

Thanks

Guide contributeur