File was renamed from analysis/demo/simpleIPC.go |
| | |
| | | "gocv.io/x/gocv" |
| | | ) |
| | | |
| | | // RunYoloFromIPC recv data from ipc |
| | | func RunYoloFromIPC(ipcURL string, asServer bool) { |
| | | imageChan := make(chan srv.ImageInfo) |
| | | |
| | | d := srv.NewReciever(ipcURL, imageChan) |
| | | go d.Run(asServer) |
| | | |
| | | cfg := "./data/yolo/cfg/yolov3.cfg" |
| | | weights := "./data/yolo/yolov3.weights" |
| | | name := "./data/yolo/data/coco.names" |
| | | |
| | | yolo := gosdk.InitYolo(cfg, weights, name, 0) |
| | | |
| | | handleImage(yolo, imageChan) |
| | | |
| | | } |
| | | |
| | | func min(x, y int) int { |
| | | if x > y { |
| | | return y |
| | |
| | | var startYolo bool |
| | | var m sync.Mutex |
| | | |
| | | func handleImage(yolo *gosdk.YoloHandle, ch <-chan srv.ImageInfo) { |
| | | // ShowYolo show yolo result |
| | | func ShowYolo(ch <-chan srv.ImageInfo) { |
| | | |
| | | cfg := "./data/yolo/cfg/yolov3.cfg" |
| | | weights := "./data/yolo/yolov3.weights" |
| | | name := "./data/yolo/data/coco.names" |
| | | |
| | | yolo := gosdk.InitYolo(cfg, weights, name, 0) |
| | | |
| | | window := gocv.NewWindow("Yolo") |
| | | |
| | | pic := gocv.NewMat() |