派生自 libgowrapper/yolo

zhangmeng
2019-12-10 51d372c3836b5f8b420bfb8104ce9ffbf2c4d786
update
1个文件已修改
17 ■■■■ 已修改文件
goyolo.go 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
goyolo.go
@@ -68,14 +68,6 @@
// RatioInterTrack 跟踪判断重叠阈值
const RatioInterTrack = 50 //跟踪判断重叠阈值
// SDKImage sdk image
type SDKImage struct {
    Data    []byte
    Width   int
    Height  int
    Channel int
}
// NewYolo init yolo sdk
func NewYolo(fc, fw, fn string, gi int) *YoloHandle {
@@ -254,6 +246,13 @@
// YoloDetectTrack yolo detect   (只识别人)
func YoloDetectTrack(y *YoloHandle, id string, data []byte, w, h, c int, thrsh float32, umns int) ([]byte, []byte) {
    if data == nil || w <= 0 || h <= 0 {
        return nil, nil
    }
    channel := c
    if channel == 0 {
        channel = 3
    }
    v, ok := y.tracker[id]
    if !ok {
@@ -261,7 +260,7 @@
        y.tracker[id] = i
        v = i
    }
    whole, recent := YoloDetectTrack2(y, v.lastTrackObjs, &v.lastTrackID, data, w, h, c, thrsh, umns)
    whole, recent := YoloDetectTrack2(y, v.lastTrackObjs, &v.lastTrackID, data, w, h, channel, thrsh, umns)
    y.tracker[id].lastTrackObjs = whole
    y.tracker[id].lastTrackID = v.lastTrackID