diff --git a/internal/photoprism/faces.go b/internal/photoprism/faces.go index 0a3fb9951..e672d14ca 100644 --- a/internal/photoprism/faces.go +++ b/internal/photoprism/faces.go @@ -283,8 +283,8 @@ func (w *Faces) Start(opt FacesOptions) (err error) { } } - // Match existing markers and faces. - if recognized, unknown, err = w.MatchMarkers(); err != nil { + // Match markers with faces and subjects. + if recognized, unknown, err = w.Match(); err != nil { return err } diff --git a/internal/photoprism/faces_match.go b/internal/photoprism/faces_match.go index 0fdd56ad9..edf747438 100644 --- a/internal/photoprism/faces_match.go +++ b/internal/photoprism/faces_match.go @@ -11,8 +11,8 @@ import ( "github.com/photoprism/photoprism/pkg/clusters" ) -// MatchMarkers matches existing markers and faces. -func (w *Faces) MatchMarkers() (recognized, unknown int64, err error) { +// Match matches markers with faces and subjects. +func (w *Faces) Match() (recognized, unknown int64, err error) { if w.Disabled() { return 0, 0, nil } diff --git a/internal/photoprism/import.go b/internal/photoprism/import.go index 784da5aa6..f113bc7f4 100644 --- a/internal/photoprism/import.go +++ b/internal/photoprism/import.go @@ -238,6 +238,15 @@ func (imp *Import) Start(opt ImportOptions) fs.Done { } if filesImported > 0 { + // Match existing faces if facial recognition is enabled. + if w := NewFaces(imp.conf); w.Disabled() { + log.Debugf("import: skipping facial recognition") + } else if recognized, unknown, err := w.Match(); err != nil { + log.Errorf("import: %s", err) + } else if recognized > 0 || unknown > 0 { + log.Infof("faces: %d recognized, %d unknown", recognized, unknown) + } + if err := entity.UpdatePhotoCounts(); err != nil { log.Errorf("import: %s", err) } diff --git a/internal/photoprism/index.go b/internal/photoprism/index.go index 33d73fae8..528ddcc32 100644 --- a/internal/photoprism/index.go +++ b/internal/photoprism/index.go @@ -233,7 +233,7 @@ func (ind *Index) Start(opt IndexOptions) fs.Done { // Match existing faces if facial recognition is enabled. if w := NewFaces(ind.conf); w.Disabled() { log.Debugf("index: skipping facial recognition") - } else if recognized, unknown, err := w.MatchMarkers(); err != nil { + } else if recognized, unknown, err := w.Match(); err != nil { log.Errorf("index: %s", err) } else if recognized > 0 || unknown > 0 { log.Infof("faces: %d recognized, %d unknown", recognized, unknown)