From 2f5f0c75f3257b4ea9c37df6d02e5598b975740f Mon Sep 17 00:00:00 2001 From: zhangmeng <775834166@qq.com> Date: 星期三, 11 十二月 2019 17:10:27 +0800 Subject: [PATCH] copy from VAProcess --- work/sdk/fextract.go | 60 +----------------------------------------------------------- 1 files changed, 1 insertions(+), 59 deletions(-) diff --git a/work/sdk/fextract.go b/work/sdk/fextract.go index f23d23a..ea51493 100644 --- a/work/sdk/fextract.go +++ b/work/sdk/fextract.go @@ -17,12 +17,6 @@ // Init impl interface func (e *EFExtract) Init() bool { - // i := gogpu.IdleGPU(100) - // if i < 0 { - // logo.Errorln("there is no gpu resource to run faceextract") - // return false - // } - // gosdk.InitFaceExtractor(10, -1) // i not work return true } @@ -30,64 +24,12 @@ // Run impl interface func (e *EFExtract) Run(ctx context.Context, in <-chan work.MsgRS, out chan<- work.MsgRS, typ string) { - // if typ == work.FCompare { - // runCompare(ctx, in, out, typ) - // return - // } -loop: for { select { case <-ctx.Done(): - break loop + return default: rMsg := <-in - // if !validRemoteMessage(rMsg, typ) { - // continue - // } - // i := unpackImage(rMsg, typ) - // if i == nil { - // continue - // } - - // var dataF []byte - // for _, v := range rMsg.Msg.Tasklab.Sdkinfos { - // if v.Sdktype == work.FDetect { - // dataF = v.Sdkdata - // break - // } - // } - // if dataF == nil { - // continue - // } - // var err error - // // 鍙嶅簭鍒楀寲鏁版嵁寰楀埌sdk鍏ュ弬 - // param := protomsg.ParamFacePos{} - // // dataF := rMsg.Msg.Tasklab.Sdkinfos[rMsg.Msg.Tasklab.Index].Sdkdata - // err = proto.Unmarshal(dataF, ¶m) - // if err != nil { - // ejectResult(nil, rMsg, out) - // continue - // } - - // var data []byte - // if param.Faces != nil { - // var extComp []*protomsg.ResultFaceExtCom - // for _, v := range param.Faces { - // feat := v.Feats - - // var res []byte - // res = cache.Getdbpersonmsg(string(feat), true) - // f := &protomsg.ResultFaceExtCom{Feats: feat, Comp: res, Pos: v} - // extComp = append(extComp, f) - // } - - // faceExtComp := protomsg.ParamFaceFeature{ExtComp: extComp} - // data, err = proto.Marshal(&faceExtComp) - // if err != nil { - // logo.Errorln("fextract marshal proto face extract error", err) - // continue - // } - // } ejectResult(nil, rMsg, out) } -- Gitblit v1.8.0