Faces: Add embeddings test cases #3124
Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
parent
a934d74c26
commit
2bf6b2a7f6
2 changed files with 66 additions and 0 deletions
|
@ -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
Loading…
Add table
Reference in a new issue