From 2480bf49eadff7a4cb023e1ca1a709cca8bed5a4 Mon Sep 17 00:00:00 2001 From: yuyuanshifu <747342561@qq.com> Date: Tue, 16 Mar 2021 20:28:05 +0800 Subject: [PATCH 01/12] add benchmark category --- models/cloudbrain.go | 9 +++++++++ modules/setting/setting.go | 2 ++ routers/repo/cloudbrain.go | 5 ++++- templates/repo/cloudbrain/new.tmpl | 9 +++++++++ 4 files changed, 24 insertions(+), 1 deletion(-) diff --git a/models/cloudbrain.go b/models/cloudbrain.go index 9784a58b5..f053552db 100755 --- a/models/cloudbrain.go +++ b/models/cloudbrain.go @@ -265,6 +265,15 @@ type ImageInfo struct { PlaceView string } +type Categories struct { + Category []*Category `json:"category"` +} + +type Category struct { + Id int `json:"id"` + Value string `json:"value"` +} + type CommitImageParams struct { Ip string `json:"ip"` TaskContainerId string `json:"taskContainerId"` diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 65fddc7a0..9926c154e 100755 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -443,6 +443,7 @@ var ( IsBenchmarkEnabled bool BenchmarkCode string BenchmarkServerHost string + BenchmarkCategory string //snn4imagenet config IsSnn4imagenetEnabled bool @@ -1150,6 +1151,7 @@ func NewContext() { IsBenchmarkEnabled = sec.Key("ENABLED").MustBool(false) BenchmarkCode = sec.Key("BENCHMARKCODE").MustString("https://yangzhx:justfortest123@git.openi.org.cn/yangzhx/detection_benchmark_script.git") BenchmarkServerHost = sec.Key("HOST").MustString("http://192.168.202.90:3366/") + BenchmarkCategory = sec.Key("CATEGORY").MustString("") sec = Cfg.Section("snn4imagenet") IsSnn4imagenetEnabled = sec.Key("ENABLED").MustBool(false) diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 30542e26e..c710f8c5b 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -108,7 +108,6 @@ func CloudBrainNew(ctx *context.Context) { } for i, payload := range resultPublic.Payload.ImageInfo { - log.Info(resultPublic.Payload.ImageInfo[i].Place) if strings.HasPrefix(resultPublic.Payload.ImageInfo[i].Place, "192.168") { resultPublic.Payload.ImageInfo[i].PlaceView = payload.Place[strings.Index(payload.Place, "/"):len(payload.Place)] } else { @@ -131,6 +130,10 @@ func CloudBrainNew(ctx *context.Context) { ctx.Data["model_path"] = cloudbrain.ModelMountPath ctx.Data["benchmark_path"] = cloudbrain.BenchMarkMountPath ctx.Data["is_benchmark_enabled"] = setting.IsBenchmarkEnabled + + var categories *models.Categories + json.Unmarshal([]byte(setting.BenchmarkCategory), &categories) + ctx.Data["benchmark_categories"] = categories.Category ctx.Data["snn4imagenet_path"] = cloudbrain.Snn4imagenetMountPath ctx.Data["is_snn4imagenet_enabled"] = setting.IsSnn4imagenetEnabled ctx.HTML(200, tplCloudBrainNew) diff --git a/templates/repo/cloudbrain/new.tmpl b/templates/repo/cloudbrain/new.tmpl index ddbe087d3..28e33cec2 100755 --- a/templates/repo/cloudbrain/new.tmpl +++ b/templates/repo/cloudbrain/new.tmpl @@ -125,6 +125,15 @@ +
+ + +
+
{{range .benchmark_categories}} - + {{end}}
From d3c77d1957207e7be2e20b868c4c333f6e641d5d Mon Sep 17 00:00:00 2001 From: Gitea Date: Wed, 17 Mar 2021 16:17:54 +0800 Subject: [PATCH 03/12] add benchmark_category --- templates/repo/cloudbrain/new.tmpl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/templates/repo/cloudbrain/new.tmpl b/templates/repo/cloudbrain/new.tmpl index 2c4832736..92704292e 100755 --- a/templates/repo/cloudbrain/new.tmpl +++ b/templates/repo/cloudbrain/new.tmpl @@ -126,8 +126,8 @@
- - {{range .benchmark_categories}} {{end}} @@ -140,9 +140,6 @@ {{range .images}} {{end}} - {{range .public_images}} - - {{end}}
@@ -206,6 +203,11 @@ } } + $('.clearable.example .ui.inline.dropdown') + .dropdown({ + placeholder: "选择数据集类别" + }) + $('select.dropdown') .dropdown(); From 68463ed7471ef28f2151f8949b36ef8c7c235275 Mon Sep 17 00:00:00 2001 From: Gitea Date: Wed, 17 Mar 2021 16:37:21 +0800 Subject: [PATCH 04/12] add benchmark_category --- templates/repo/cloudbrain/new.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/repo/cloudbrain/new.tmpl b/templates/repo/cloudbrain/new.tmpl index 92704292e..07399a42f 100755 --- a/templates/repo/cloudbrain/new.tmpl +++ b/templates/repo/cloudbrain/new.tmpl @@ -127,7 +127,7 @@
- {{range .benchmark_categories}} {{end}} @@ -203,7 +203,7 @@ } } - $('.clearable.example .ui.inline.dropdown') + $('#cloudbrain_benchmark_category') .dropdown({ placeholder: "选择数据集类别" }) From 594173fe29be57d3c6e886197707e17fc772abb8 Mon Sep 17 00:00:00 2001 From: Gitea Date: Wed, 17 Mar 2021 16:39:55 +0800 Subject: [PATCH 05/12] add benchmark_category --- templates/repo/cloudbrain/new.tmpl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/templates/repo/cloudbrain/new.tmpl b/templates/repo/cloudbrain/new.tmpl index 07399a42f..a93abd989 100755 --- a/templates/repo/cloudbrain/new.tmpl +++ b/templates/repo/cloudbrain/new.tmpl @@ -140,6 +140,9 @@ {{range .images}} {{end}} + {{range .public_images}} + + {{end}}
From b629052beaa972941ef5c7e493bd2caac5bbb315 Mon Sep 17 00:00:00 2001 From: yuyuanshifu <747342561@qq.com> Date: Wed, 17 Mar 2021 17:44:39 +0800 Subject: [PATCH 06/12] foot --- templates/base/footer_content.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/base/footer_content.tmpl b/templates/base/footer_content.tmpl index 1c164bc0c..8f29f371b 100755 --- a/templates/base/footer_content.tmpl +++ b/templates/base/footer_content.tmpl @@ -33,7 +33,7 @@
{{.i18n.Tr "custom.foot.copyright"}} 京ICP备18004880号-2
- {{.i18n.Tr "powered_by 鹏城实验室云脑、"}}Trustie确实、{{.i18n.Tr "、gitea"}} + {{.i18n.Tr "powered_by 鹏城实验室云脑、"}}Trustie确实{{.i18n.Tr "、gitea"}}
From 56cf371099fc832f9ac70a89c0ac9d951f341ffb Mon Sep 17 00:00:00 2001 From: Gitea Date: Wed, 17 Mar 2021 20:45:41 +0800 Subject: [PATCH 07/12] debug multi category --- templates/repo/cloudbrain/new.tmpl | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/templates/repo/cloudbrain/new.tmpl b/templates/repo/cloudbrain/new.tmpl index a93abd989..02d84a68d 100755 --- a/templates/repo/cloudbrain/new.tmpl +++ b/templates/repo/cloudbrain/new.tmpl @@ -179,6 +179,7 @@ +