diff --git a/internal/face/detector.go b/internal/face/detector.go index 660f0812c..049afa5df 100644 --- a/internal/face/detector.go +++ b/internal/face/detector.go @@ -140,11 +140,11 @@ func (fd *Detector) Detect(fileName string) (faces []pigo.Detection, params pigo var maxSize int if cols < 20 || rows < 20 || cols < fd.minSize || rows < fd.minSize { - return faces, params, fmt.Errorf("image too small (%dx%d)", cols, rows) + return faces, params, fmt.Errorf("image size %dx%d is too small", cols, rows) } else if cols < rows { - maxSize = cols - 10 + maxSize = cols - 8 } else { - maxSize = rows - 10 + maxSize = rows - 8 } imageParams := &pigo.ImageParams{ @@ -166,6 +166,8 @@ func (fd *Detector) Detect(fileName string) (faces []pigo.Detection, params pigo ImageParams: *imageParams, } + log.Debugf("faces: image size %dx%d, face size min %d, max %d", cols, rows, params.MinSize, params.MaxSize) + // Run the classifier over the obtained leaf nodes and return the Face results. // The result contains quadruplets representing the row, column, scale and Face score. faces = classifier.RunCascade(params, fd.angle) diff --git a/internal/face/net.go b/internal/face/net.go index 080f5662f..0aa82eb0f 100644 --- a/internal/face/net.go +++ b/internal/face/net.go @@ -150,7 +150,7 @@ func (t *Net) getFaceCrop(fileName, cacheHash string, f *Face) (img image.Image, } else if img, err := imaging.Open(cacheFile); err != nil { log.Errorf("faces: failed loading %s", filepath.Base(cacheFile)) } else { - log.Debugf("faces: using %s", filepath.Base(cacheFile)) + log.Debugf("faces: extracting from %s", filepath.Base(cacheFile)) return img, nil }