From 0ea2815ff30489781880fb48f1b9a748c44e091e Mon Sep 17 00:00:00 2001 From: liuxiaolong <736321739@qq.com> Date: 星期四, 01 八月 2019 11:40:59 +0800 Subject: [PATCH] test --- controllers/fileController.go | 18 +++++++++++++++--- 1 files changed, 15 insertions(+), 3 deletions(-) diff --git a/controllers/fileController.go b/controllers/fileController.go index d801abd..9284697 100644 --- a/controllers/fileController.go +++ b/controllers/fileController.go @@ -17,6 +17,7 @@ "mime/multipart" "net/http" "path" + "sort" "strconv" "strings" "time" @@ -365,12 +366,23 @@ compareService := service.NewFaceCompareService(arg) compareOnce := compareService.Compare() totalData := compareOnce.CompareData + logger.Debug("comp 姣斿缁撴潫锛岀敤鏃讹細",time.Since(timeStart)) m := make(map[string]interface{},3) - if totalData!=nil && len(*totalData)>0{ + if totalData != nil && totalData.Len() > 0{ //鎸夊垎鍊兼帓搴� - service.SortByScore(totalData) - total := len(*totalData) + var scorePre []float32 + for _,f1 :=range *totalData { + scorePre = append(scorePre, f1.CompareScore) + } + logger.Debug("comp 鎺掑簭鍓嶅垎鍊兼暟缁勶細",scorePre) + sort.Sort(totalData) + var scoreAf []float32 + for _,f2 :=range *totalData { + scoreAf = append(scoreAf, f2.CompareScore) + } + logger.Debug("comp 鎺掑簭鍚庡垎鍊兼暟缁勶細",scoreAf) + total := totalData.Len() m["compareNum"] = compareOnce.CompareNum m["total"] = total -- Gitblit v1.8.0