派生自 libgowrapper/yolo

zhangmeng
2019-12-10 336d6b2cb9b3d9c20aff4c0279a6e2cb13eec188
goyolo.go
@@ -7,7 +7,7 @@
#cgo LDFLAGS: -Wl,-rpath,${SRCDIR}/darknet/lib
#cgo LDFLAGS: -ldarknet -lcudart -lcublas -lcurand -lcudnn -lrt -ldl -lpthread
#include <stdlib.h>
#include "detector.h"
#include "cyolo.h"
*/
import "C"
import "unsafe"
@@ -60,9 +60,10 @@
// SDKImage sdk image
type SDKImage struct {
   Data   []byte
   Width  int
   Height int
   Data    []byte
   Width   int
   Height  int
   Channel int
}
// NewYolo init yolo sdk
@@ -108,12 +109,16 @@
   data := img.Data
   w := img.Width
   h := img.Height
   c := img.Channel
   if c == 0 {
      c = 3
   }
   var count C.int
   var cobjinfo unsafe.Pointer
   ret := C.detect(y.handle,
      unsafe.Pointer(&data[0]), C.int(w), C.int(h), 3,
      unsafe.Pointer(&data[0]), C.int(w), C.int(h), C.int(c),
      C.float(thrsh), C.int(umns),
      &cobjinfo, &count)