/
config_faces.go
75 lines (58 loc) Β· 2 KB
/
config_faces.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
package config
import "github.com/photoprism/photoprism/internal/face"
// FaceSize returns the face size threshold in pixels.
func (c *Config) FaceSize() int {
if c.options.FaceSize < 20 || c.options.FaceSize > 10000 {
return face.SizeThreshold
}
return c.options.FaceSize
}
// FaceScore returns the face quality score threshold.
func (c *Config) FaceScore() float64 {
if c.options.FaceScore < 1 || c.options.FaceScore > 100 {
return face.ScoreThreshold
}
return c.options.FaceScore
}
// FaceOverlap returns the face area overlap threshold in percent.
func (c *Config) FaceOverlap() int {
if c.options.FaceOverlap < 1 || c.options.FaceOverlap > 100 {
return face.OverlapThreshold
}
return c.options.FaceOverlap
}
// FaceClusterSize returns the size threshold for faces forming a cluster in pixels.
func (c *Config) FaceClusterSize() int {
if c.options.FaceClusterSize < 20 || c.options.FaceClusterSize > 10000 {
return face.ClusterSizeThreshold
}
return c.options.FaceClusterSize
}
// FaceClusterScore returns the quality threshold for faces forming a cluster.
func (c *Config) FaceClusterScore() int {
if c.options.FaceClusterScore < 1 || c.options.FaceClusterScore > 100 {
return face.ClusterScoreThreshold
}
return c.options.FaceClusterScore
}
// FaceClusterCore returns the number of faces forming a cluster core.
func (c *Config) FaceClusterCore() int {
if c.options.FaceClusterCore < 1 || c.options.FaceClusterCore > 100 {
return face.ClusterCore
}
return c.options.FaceClusterCore
}
// FaceClusterDist returns the radius of faces forming a cluster core.
func (c *Config) FaceClusterDist() float64 {
if c.options.FaceClusterDist < 0.1 || c.options.FaceClusterDist > 1.5 {
return face.ClusterDist
}
return c.options.FaceClusterDist
}
// FaceMatchDist returns the offset distance when matching faces with clusters.
func (c *Config) FaceMatchDist() float64 {
if c.options.FaceMatchDist < 0.1 || c.options.FaceMatchDist > 1.5 {
return face.MatchDist
}
return c.options.FaceMatchDist
}