派生自 libgowrapper/yolo

zhangmeng
2019-12-10 4ad008ef781f02bfd65fc3e71d3917959fcaca74
update
1个文件已修改
14 ■■■■ 已修改文件
goyolo.go 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
goyolo.go
@@ -96,7 +96,7 @@
}
// Free free
func (y *YoloHandle) Free() {
func Free(y *YoloHandle) {
    if y != nil {
        if y.handle != nil {
            C.release(y.handle)
@@ -117,7 +117,7 @@
}
// YoloDetect yolo detect
func (y *YoloHandle) YoloDetect(data []byte, w, h, c int, thrsh float32, umns int) []CObjInfo {
func YoloDetect(y *YoloHandle, data []byte, w, h, c int, thrsh float32, umns int) []CObjInfo {
    var count C.int
    var cobjinfo unsafe.Pointer
@@ -134,7 +134,7 @@
}
// YoloObjName obj name by type
func (y *YoloHandle) YoloObjName(typ int) string {
func YoloObjName(y *YoloHandle, typ int) string {
    p := C.obj_name_by_type(y.handle, C.int(typ))
    return C.GoString(p)
@@ -182,11 +182,11 @@
}
// YoloDetectTrack2 yolo detect   (只识别人)
func (y *YoloHandle) YoloDetectTrack2(LastYoloObjs []CObjTrackInfo, LastTrackID *uint64, data []byte, w, h, c int, thrsh float32, umns int) (allObjs []CObjTrackInfo, newObjs []CObjTrackInfo) {
func YoloDetectTrack2(y *YoloHandle, LastYoloObjs []CObjTrackInfo, LastTrackID *uint64, data []byte, w, h, c int, thrsh float32, umns int) (allObjs []CObjTrackInfo, newObjs []CObjTrackInfo) {
    var tmp CObjTrackInfo
    //LastYoloObjs
    detectObjs := y.YoloDetect(data, w, h, c, thrsh, umns)
    detectObjs := YoloDetect(y, data, w, h, c, thrsh, umns)
    for _, vLast := range LastYoloObjs {
        for i := 0; i < len(detectObjs); i++ {
@@ -253,7 +253,7 @@
}
// YoloDetectTrack yolo detect   (只识别人)
func (y *YoloHandle) YoloDetectTrack(id string, data []byte, w, h, c int, thrsh float32, umns int) ([]byte, []byte) {
func YoloDetectTrack(y *YoloHandle, id string, data []byte, w, h, c int, thrsh float32, umns int) ([]byte, []byte) {
    v, ok := y.tracker[id]
    if !ok {
@@ -261,7 +261,7 @@
        y.tracker[id] = i
        v = i
    }
    whole, recent := y.YoloDetectTrack2(v.lastTrackObjs, &v.lastTrackID, data, w, h, c, thrsh, umns)
    whole, recent := YoloDetectTrack2(y, v.lastTrackObjs, &v.lastTrackID, data, w, h, c, thrsh, umns)
    y.tracker[id].lastTrackObjs = whole
    y.tracker[id].lastTrackID = v.lastTrackID