zhangmeng
2019-12-19 0ea9f3f17bce70bf61a276f9531684460a3f3856
dupate
1个文件已修改
18 ■■■■ 已修改文件
work/sdk/humantrack.go 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
work/sdk/humantrack.go
@@ -38,8 +38,8 @@
        recvImageCount: 0,
        index:          0,
        images: make([]*gohumantrack.ImageHumanTracker, batchSize),
        msgs: make([]*work.MsgRS, batchSize),
        images:         make([]*gohumantrack.ImageHumanTracker, batchSize),
        msgs:           make([]*work.MsgRS, batchSize),
    }
}
@@ -94,7 +94,7 @@
        return
    }
    hr := convert2ProtoHumanTrackResult(res)
    hr := convert2ProtoHumanTrackResult(res[0])
    result := protomsg.HumanTrackResult{Result: hr}
    data, err := proto.Marshal(&result)
    if err != nil {
@@ -106,7 +106,7 @@
    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))
}
@@ -140,12 +140,12 @@
        }
    }
    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
@@ -181,7 +181,7 @@
        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))
    }
@@ -208,8 +208,8 @@
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,