zhangmeng
2019-12-17 00d07f58cd88a1e9dd13deed75ad1af3db6ebcf6
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
}