Faces: Add embeddings test cases #3124

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer 2023-02-24 14:03:13 +01:00
parent a934d74c26
commit 2bf6b2a7f6
2 changed files with 66 additions and 0 deletions

View file

@ -48,6 +48,17 @@ func (embeddings Embeddings) Count() int {
return len(embeddings)
}
// Kind returns the type of face e.g. regular, kids, or ignored.
func (embeddings Embeddings) Kind() (result Kind) {
for _, e := range embeddings {
if k := e.Kind(); k > result {
result = k
}
}
return result
}
// One tests if there is exactly one embedding.
func (embeddings Embeddings) One() bool {
return embeddings.Count() == 1

File diff suppressed because one or more lines are too long