diff --git a/scanner/scanner.c b/scanner/scanner.c index ccd8fcc..fd077f6 100644 --- a/scanner/scanner.c +++ b/scanner/scanner.c @@ -147,6 +147,8 @@ long int chainLength(FaceLink *pLink) { return count; } +long int maxPts = 0; + long int DBSCAN(Face **ppFaces, long int faceCount, double eps, int minPts) { long int C = 0; for (long int i = 0; i < faceCount; i++) { @@ -157,6 +159,10 @@ long int DBSCAN(Face **ppFaces, long int faceCount, double eps, int minPts) { FaceLink *pNeighbors = RangeQuery(ppFaces, faceCount, pFace, eps); long neighborCount = chainLength(pNeighbors); + if (neighborCount > maxPts) { + maxPts = neighborCount; + fprintf(stderr, "New max with id %ld: %ld\n", pFace->faceId, maxPts); + } if (neighborCount < minPts) { pFace->clusterType = NOISE; freeChain(pNeighbors); @@ -193,6 +199,10 @@ long int DBSCAN(Face **ppFaces, long int faceCount, double eps, int minPts) { FaceLink *pSubNeighbors = RangeQuery(ppFaces, faceCount, pQ, eps); neighborCount = chainLength(pSubNeighbors); if (neighborCount >= minPts) { + if (neighborCount > maxPts) { + maxPts = neighborCount; + fprintf(stderr, "New max with id %ld: %ld\n", pFace->faceId, maxPts); + } pQ->clusterType = CORE; /* Append these neighbors to the end of the chain */ FaceLink *pTmp = pLink; @@ -291,7 +301,7 @@ int main(int argc, char *argv[]) { } count++; if (count % 1000 == 0) { - fprintf(stderr, "...read %ld...\n", count); + fprintf(stderr, "Read %ld%% of descriptors.\n", (100 * count / entries)); } } closedir(faceDir); diff --git a/server/face-recognizer.js b/server/face-recognizer.js index e33f079..da8fcc3 100644 --- a/server/face-recognizer.js +++ b/server/face-recognizer.js @@ -155,7 +155,7 @@ require("./db/photos").then(function(db) { const image = await canvas.loadImage(picturesPath + photoPath); const detections = await faceapi.detectAllFaces(image, new faceapi.SsdMobilenetv1Options({ - minConfidence: 0.8 + minConfidence: 0.9 }) ).withFaceLandmarks(); diff --git a/server/face.js b/server/face.js index a0156e5..99a8128 100644 --- a/server/face.js +++ b/server/face.js @@ -159,9 +159,9 @@ require("./db/photos").then(function(db) { console.log(`Loading ${file}...`); id = undefined; loader = canvas.loadImage(picturesPath + file).then(async (image) => { - const detectors = await faceapi.detectAllFaces(image, + const detectors = await faceapi.detectAllFaces(image, new faceapi.SsdMobilenetv1Options({ - minConfidence: 0.8 + minConfidence: 0.9 }) ).withFaceLandmarks();