Backend: Update label rules

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer 2020-04-17 21:28:32 +02:00
parent 20a5912210
commit 8b36220c68
3 changed files with 23 additions and 13 deletions

View file

@ -1266,7 +1266,7 @@ var rules = LabelRules{
Label: "wild cat",
Threshold: 0.700000,
Priority: 0,
Categories: []string{},
Categories: []string{"cat", "animal", "wildlife"},
},
"chesapeake bay retriever dog": {
Label: "dog",
@ -1956,7 +1956,7 @@ var rules = LabelRules{
Label: "cat",
Threshold: 0.300000,
Priority: 0,
Categories: []string{},
Categories: []string{"animal"},
},
"electric fan": {
Label: "fan",
@ -4188,7 +4188,7 @@ var rules = LabelRules{
Label: "cat",
Threshold: 0.300000,
Priority: 0,
Categories: []string{},
Categories: []string{"animal"},
},
"petri dish": {
Label: "",
@ -5076,7 +5076,7 @@ var rules = LabelRules{
Label: "cat",
Threshold: 0.300000,
Priority: 0,
Categories: []string{},
Categories: []string{"animal"},
},
"siberian husky dog": {
Label: "dog",

View file

@ -11,14 +11,20 @@ tabby cat:
persian cat:
label: cat
threshold: 0.3
categories:
- animal
siamese cat:
label: cat
threshold: 0.3
categories:
- animal
egyptian cat:
label: cat
threshold: 0.3
categories:
- animal
tiger cat:
priority: 5
@ -67,6 +73,10 @@ lion:
cheetah:
label: wild cat
threshold: 0.7
categories:
- cat
- animal
- wildlife
tiger:
see: wild cat

View file

@ -2,15 +2,15 @@ package form
// PhotoSearch represents search form fields for "/api/v1/labels".
type LabelSearch struct {
Query string `form:"q"`
ID string `form:"id"`
Slug string `form:"slug"`
Name string `form:"name"`
All bool `form:"all"`
Favorites bool `form:"favorites"`
Count int `form:"count" binding:"required"`
Offset int `form:"offset"`
Order string `form:"order"`
Query string `form:"q"`
ID string `form:"id"`
Slug string `form:"slug"`
Name string `form:"name"`
All bool `form:"all"`
Favorites bool `form:"favorites"`
Count int `form:"count" binding:"required"`
Offset int `form:"offset"`
Order string `form:"order"`
}
func (f *LabelSearch) GetQuery() string {