justadudewhohacks/face-api.js

Q: How to serialize/unserialize FullFaceDescriptions?

Offen

#227 geöffnet am 27.02.2019

 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)TypeScript (3.649 Forks)batch import
enhancementgood first issuehelp wanted

Repository-Metriken

Stars
 (15.839 Sterne)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

Detecting faces is great, but can be slow. I'd like to save the detections to an IndexDB and do some math on them when all are completed.

Is there a standard/easy way to do this? I've got a Dexie hacky way with

db.addFace = async function(imageName, tileLocation, ffd) {
  return await db.faces.add({
    'image_name':imageName,
    'tile_x':tileLocation.x,
    'tile_y':tileLocation.y,
    'x':ffd.detection.box.x,
    'y':ffd.detection.box.y,
    'w':ffd.detection.box.width,
    'h':ffd.detection.box.height,
    'score':ffd.detection.score,
    'descriptor':ffd.descriptor,
    'landmarks': ffd.landmarks,
    'expressions': ffd.expressions
  });
};

that I'm sure is a bad idea.

Contributor Guide