| | |
| | | |
| | | recvImageCount: 0, |
| | | index: 0, |
| | | images: make([]*gohumantrack.ImageHumanTracker, batchSize), |
| | | msgs: make([]*work.MsgRS, batchSize), |
| | | images: make([]*gohumantrack.ImageHumanTracker, batchSize), |
| | | msgs: make([]*work.MsgRS, batchSize), |
| | | } |
| | | } |
| | | |
| | |
| | | return |
| | | } |
| | | |
| | | hr := convert2ProtoHumanTrackResult(res) |
| | | hr := convert2ProtoHumanTrackResult(res[0]) |
| | | result := protomsg.HumanTrackResult{Result: hr} |
| | | data, err := proto.Marshal(&result) |
| | | if err != nil { |
| | |
| | | if rMsg.Msg.Tasklab != nil { |
| | | id, name = rMsg.Msg.Tasklab.Taskid, rMsg.Msg.Tasklab.Taskname |
| | | } |
| | | logo.Infoln("CAMERAID: ", rMsg.Msg.Cid, " TASKID: ", id, " TASKNAME: ", name, " Human Track COUNT: ", len(hr[0])) |
| | | logo.Infoln("CAMERAID: ", rMsg.Msg.Cid, " TASKID: ", id, " TASKNAME: ", name, " Human Track COUNT: ", len(hr)) |
| | | |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | if i, ok := t.mapCameraImageIndex[rMsg.Msg.Cid]; ok { |
| | | if i < batchSize { |
| | | if i < t.batchSize { |
| | | t.images[i] = &img |
| | | t.msgs[i] = &rMsg |
| | | } |
| | | } else { |
| | | if t.index < batchSize { |
| | | if t.index < t.batchSize { |
| | | t.images[t.index] = &img |
| | | t.msgs[t.index] = &rMsg |
| | | t.mapCameraImageIndex[rMsg.Msg.Cid] = t.index |
| | |
| | | if msg.Msg.Tasklab != nil { |
| | | id, name = msg.Msg.Tasklab.Taskid, msg.Msg.Tasklab.Taskname |
| | | } |
| | | logo.Infoln("CAMERAID: ", msg.Msg.Cid, " TASKID: ", id, " TASKNAME: ", name, " Human Track COUNT: ", len(hr[0])) |
| | | logo.Infoln("CAMERAID: ", msg.Msg.Cid, " TASKID: ", id, " TASKNAME: ", name, " Human Track COUNT: ", len(hr)) |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | func convert2ProtoHumanTrackResult(obj gohumantrack.FgResult) []*protomsg.HumanTrack { |
| | | res := []*protomsg.HumanTrack{} |
| | | for i := 0; i < int(v.FgNum); i++ { |
| | | r := v.Fginfo[i] |
| | | for i := 0; i < int(obj.FgNum); i++ { |
| | | r := obj.Fginfo[i] |
| | | rect := protomsg.Rect{ |
| | | Left: r.Left, |
| | | Right: r.Right, |