From 97c8be11558c7aff01ecdbf3d2a6470e2255a013 Mon Sep 17 00:00:00 2001
From: zhangmeng <775834166@qq.com>
Date: 星期五, 13 十二月 2019 12:25:24 +0800
Subject: [PATCH] add humantrack

---
 proc/proc.go |   41 +++++++++++++++++++++++++++++++++++------
 1 files changed, 35 insertions(+), 6 deletions(-)

diff --git a/proc/proc.go b/proc/proc.go
index 28411b4..7cbaa1f 100644
--- a/proc/proc.go
+++ b/proc/proc.go
@@ -6,6 +6,7 @@
 	"analysis/work"
 	"analysis/work/sdk"
 	"context"
+	"os"
 )
 
 type infoSDK struct {
@@ -35,6 +36,29 @@
 	name    = "./data/yolo/data/coco.names"
 )
 
+const (
+	FDetect = "FaceDetect"
+	// FExtract  = "FaceExtract"
+	// FProperty = "FaceProperty"
+	FCompare   = "FaceCompare"
+	FtTract    = "FaceTrack"
+	FtDetect   = "FaceTrackDetect"
+	FtOnly     = "FaceTrackOnly"
+	YDetect    = "Yolo"
+	PlateID    = "Plate"
+	HumanTrack = "HumanTrack"
+)
+
+var (
+	SDK = []string{
+		YDetect,
+		FDetect,
+		FCompare,
+		PlateID,
+		HumanTrack,
+	}
+)
+
 func prepare(name string, gpu int) (string, bool) {
 
 	return initSDK(name, gpu)
@@ -44,7 +68,7 @@
 
 	sdkType := name
 
-	if s, f := util.FindStringInArray(sdkType, work.SDK); f {
+	if s, f := util.FindStringInArray(sdkType, SDK); f {
 		sdkType = s
 	} else {
 		logo.Errorln("THERE IS NO THIS SDK TYPE: ", sdkType)
@@ -64,23 +88,28 @@
 	var e sdk.Engine
 	ret := true
 
-	if sdkType == work.FDetect {
+	if sdkType == FDetect {
 		e, ret = createFaceDetect(gpu, thrds, util.SFI.DetectNum, util.SFI.DetectAngle, util.SFI.TrackInterval, util.SFI.SampleSize)
 
-	} else if sdkType == work.YDetect {
+	} else if sdkType == YDetect {
 		e, ret = createYolo(gpu)
 
-	} else if sdkType == work.FtTract {
+	} else if sdkType == FtTract {
 		e, ret = createFaceTrack(gpu, thrds, util.SFI.DetectNum, util.SFI.DetectAngle, util.SFI.TrackInterval, util.SFI.SampleSize)
 
-	} else if sdkType == work.FCompare {
+	} else if sdkType == FCompare {
 		e = sdk.NewEFExtract(100)
-	} else if sdkType == work.PlateID {
+	} else if sdkType == PlateID {
 		e = sdk.NewVehicleDetector(util.SCI.LicenseServerPath, util.SCI.Model, util.SCI.MaxImageWidth, util.SCI.MaxImageHeight)
+	} else if sdkType == HumanTrack {
+		e = sdk.NewHumanTracker(gpu, 1, 0)
 	}
 
 	if ret {
 		mapFunc[sdkType] = e
+	} else {
+		logo.Errorln("CREATE SDK : ", sdkType, " FAILED")
+		os.Exit(0)
 	}
 	return sdkType, ret
 }

--
Gitblit v1.8.0