photoprism/internal/classify/label_rule.go
Michael Mayer e9874d6e0c Backend: Compile labels into source #160
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
2020-01-09 01:21:09 +01:00

18 lines
303 B
Go

package classify
type LabelRule struct {
Label string
Threshold float32
Categories []string
Priority int
}
type LabelRules map[string]LabelRule
func (rules LabelRules) Find(label string) LabelRule {
if rule, ok := rules[label]; ok {
return rule
}
return LabelRule{Threshold: 0.1}
}