派生自 libgowrapper/yolo

zhangmeng
2019-12-10 642f9a5e963a54b6a00c6aa194bb8ef7cd087c0e
udpate
1个文件已修改
14 ■■■■■ 已修改文件
goyolo.go 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
goyolo.go
@@ -68,8 +68,8 @@
// RatioInterTrack 跟踪判断重叠阈值
const RatioInterTrack = 50 //跟踪判断重叠阈值
// NewYolo init yolo sdk
func NewYolo(fc, fw, fn string, gi int) *YoloHandle {
// NewSDKYolo init yolo sdk
func NewSDKYolo(fc, fw, fn string, gi int) interface{} {
    c := C.CString(fc)
    defer C.free(unsafe.Pointer(c))
@@ -88,7 +88,8 @@
}
// Free free
func Free(y *YoloHandle) {
func Free(i interface{}) {
    y := i.(*YoloHandle)
    if y != nil {
        if y.handle != nil {
            C.release(y.handle)
@@ -126,7 +127,8 @@
}
// YoloObjName obj name by type
func YoloObjName(y *YoloHandle, typ int) string {
func YoloObjName(i interface{}, typ int) string {
    y := i.(*YoloHandle)
    p := C.obj_name_by_type(y.handle, C.int(typ))
    return C.GoString(p)
@@ -216,10 +218,12 @@
}
// Run yolo detect   (只识别人)
func Run(y *YoloHandle, id string, data []byte, w, h, c int, thrsh float32, umns int) ([]byte, []byte) {
func Run(i interface{}, id string, data []byte, w, h, c int, thrsh float32, umns int) ([]byte, []byte) {
    if data == nil || w <= 0 || h <= 0 {
        return nil, nil
    }
    y := i.(*YoloHandle)
    channel := c
    if channel == 0 {
        channel = 3