From 90df8823767457454666e614e0c55907cf733799 Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Sun, 12 Jan 2020 15:39:45 +0100 Subject: [PATCH] Backend: Update label rules Signed-off-by: Michael Mayer --- Makefile | 11 +++-- internal/classify/rules.go | 86 ++++++++++++++++++------------------- internal/classify/rules.yml | 4 +- 3 files changed, 50 insertions(+), 51 deletions(-) diff --git a/Makefile b/Makefile index d3b93e47e..48b385d04 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ test: test-js test-go acceptance-all: start acceptance acceptance-firefox stop test-all: test acceptance-all fmt: fmt-js fmt-go -upgrade: upgrade-js upgrade-go +upgrade: dep-upgrade-js dep-upgrade clean-local: clean-local-config clean-local-share clean-local-cache clean-install: clean-local dep build-js install-bin install-assets start: @@ -55,6 +55,10 @@ dep-js: (cd frontend && npm install --silent) dep-go: go build -v ./... +dep-upgrade: + go get -u -t ./... +dep-upgrade-js: + (cd frontend && npm --depth 3 update) dep-tensorflow: scripts/download-nasnet.sh scripts/download-nsfw.sh @@ -135,8 +139,3 @@ fmt-go: go fmt ./pkg/... ./internal/... ./cmd/... tidy: go mod tidy -upgrade-js: - (cd frontend && npm --depth 2 update) -upgrade-go: - go mod tidy - go get -u diff --git a/internal/classify/rules.go b/internal/classify/rules.go index e9c4046d0..5b40a17e8 100644 --- a/internal/classify/rules.go +++ b/internal/classify/rules.go @@ -351,10 +351,10 @@ var rules = LabelRules{ Categories: []string{"animal"}, }, "ball": { - Label: "sports", - Threshold: 0.000000, - Priority: -1, - Categories: []string{"round"}, + Label: "", + Threshold: 1.000000, + Priority: -2, + Categories: []string{}, }, "balloon": { Label: "", @@ -453,10 +453,10 @@ var rules = LabelRules{ Categories: []string{}, }, "baseball": { - Label: "sports", - Threshold: 0.000000, - Priority: -1, - Categories: []string{"round"}, + Label: "", + Threshold: 1.000000, + Priority: -2, + Categories: []string{}, }, "basenji dog": { Label: "dog", @@ -471,10 +471,10 @@ var rules = LabelRules{ Categories: []string{}, }, "basketball": { - Label: "sports", - Threshold: 0.000000, - Priority: -1, - Categories: []string{"round"}, + Label: "", + Threshold: 1.000000, + Priority: -2, + Categories: []string{}, }, "basset dog": { Label: "dog", @@ -574,19 +574,19 @@ var rules = LabelRules{ }, "beer": { Label: "beer", - Threshold: 0.250000, + Threshold: 0.400000, Priority: 0, Categories: []string{"beverage", "drinks"}, }, "beer bottle": { Label: "beer", - Threshold: 0.250000, + Threshold: 0.400000, Priority: 0, Categories: []string{"beverage", "drinks"}, }, "beer glass": { Label: "beer", - Threshold: 0.250000, + Threshold: 0.400000, Priority: 0, Categories: []string{"beverage", "drinks"}, }, @@ -1516,7 +1516,7 @@ var rules = LabelRules{ }, "cooking": { Label: "cooking", - Threshold: 0.200000, + Threshold: 0.400000, Priority: 0, Categories: []string{}, }, @@ -2236,7 +2236,7 @@ var rules = LabelRules{ }, "frying pan": { Label: "cooking", - Threshold: 0.200000, + Threshold: 0.400000, Priority: 0, Categories: []string{}, }, @@ -2361,10 +2361,10 @@ var rules = LabelRules{ Categories: []string{"water", "animal"}, }, "golf ball": { - Label: "sports", - Threshold: 0.000000, - Priority: -1, - Categories: []string{"round"}, + Label: "", + Threshold: 1.000000, + Priority: -2, + Categories: []string{}, }, "golfcart": { Label: "outdoor", @@ -3148,7 +3148,7 @@ var rules = LabelRules{ }, "ladle": { Label: "cooking", - Threshold: 0.200000, + Threshold: 0.400000, Priority: 0, Categories: []string{}, }, @@ -3994,7 +3994,7 @@ var rules = LabelRules{ }, "pan": { Label: "cooking", - Threshold: 0.200000, + Threshold: 0.400000, Priority: 0, Categories: []string{}, }, @@ -4209,10 +4209,10 @@ var rules = LabelRules{ Categories: []string{"fruit"}, }, "ping-pong ball": { - Label: "sports", - Threshold: 0.000000, - Priority: -1, - Categories: []string{"round"}, + Label: "", + Threshold: 1.000000, + Priority: -2, + Categories: []string{}, }, "pinwheel": { Label: "", @@ -4707,10 +4707,10 @@ var rules = LabelRules{ Categories: []string{"animal"}, }, "rugby ball": { - Label: "sports", - Threshold: 0.000000, - Priority: -1, - Categories: []string{"round"}, + Label: "", + Threshold: 1.000000, + Priority: -2, + Categories: []string{}, }, "rule": { Label: "", @@ -5097,10 +5097,10 @@ var rules = LabelRules{ Categories: []string{}, }, "soccer ball": { - Label: "sports", - Threshold: 0.000000, - Priority: -1, - Categories: []string{"round"}, + Label: "", + Threshold: 1.000000, + Priority: -2, + Categories: []string{}, }, "sock": { Label: "portrait", @@ -5529,10 +5529,10 @@ var rules = LabelRules{ Categories: []string{"water", "animal"}, }, "tennis ball": { - Label: "sports", - Threshold: 0.000000, - Priority: -1, - Categories: []string{"round"}, + Label: "", + Threshold: 1.000000, + Priority: -2, + Categories: []string{}, }, "terrapin": { Label: "turtle", @@ -5919,10 +5919,10 @@ var rules = LabelRules{ Categories: []string{}, }, "volleyball": { - Label: "sports", - Threshold: 0.000000, - Priority: -1, - Categories: []string{"round"}, + Label: "", + Threshold: 1.000000, + Priority: -2, + Categories: []string{}, }, "vulture bird": { Label: "bird", diff --git a/internal/classify/rules.yml b/internal/classify/rules.yml index df2fee516..4dffbd69b 100644 --- a/internal/classify/rules.yml +++ b/internal/classify/rules.yml @@ -1880,7 +1880,7 @@ beacon: beer: label: beer - threshold: 0.25 + threshold: 0.4 categories: - beverage - drinks @@ -2352,7 +2352,7 @@ jeep: cooking: label: cooking - threshold: 0.2 + threshold: 0.4 pan: see: cooking