garfeng / go_yolov5

Golang, Go, GoCV, YoloV5, Windows, CUDA

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use YoloV5 with Golang. CUDA avaiable on Windows

YoloV5 GoCV Golang CUDA Windows

Dependences

Step

  1. Download the code
git clone https://github.com/garfeng/go_yolov5.git
  1. Build

Before build, please ensure that, there are 3 dlls in C:/opencv/cvglue/bin

admin@pc MINGW64 /c/opencv/cvglue
$ tree
.
├── bin
│   ├── gocv.dll 
│   ├── gocv_contrib.dll
│   └── gocv_cuda.dll
└── lib
    ├── gocv.lib
    ├── gocv_contrib.lib
    └── gocv_cuda.lib

2 directories, 6 files

Then build go_yolov5.

cd go_yolov5
go build
cp /c/opencv/cvglue/bin/gocv.dll ./
cp /c/opencv/cvglue/bin/gocv_cuda.dll ./
  1. Run it
./go_yolov5.exe

It equals:

./go_yolov5.exe -model yolov5s.onnx -size 640 -image images/face.jpg

Or run go_yolov5.exe with your own model and images.

./go_yolov5.exe -model <model path> -size <size> -image <input image>

About

Golang, Go, GoCV, YoloV5, Windows, CUDA


Languages

Language:Go 100.0%