You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# go-darknet: Go bindings for Darknet (Yolo V4, Yolo V3)
8
7
### go-darknet is a Go package, which uses Cgo to enable Go applications to use YOLO V4/V3 in [Darknet].
9
8
@@ -23,29 +22,20 @@
23
22
24
23
## Requirements
25
24
26
-
For proper codebase please use fork of [darknet](https://github.com/AlexeyAB/darknet). Latest commit I've tested [here](https://github.com/AlexeyAB/darknet/commit/d65909fbea471d06e52a2e4a41132380dc2edaa6)
27
-
28
-
In order to use go-darknet, `libdarknet.so` should be available in one of
29
-
the following locations:
25
+
You need to install fork of [darknet](https://github.com/AlexeyAB/darknet). Latest commit I've tested is [here](https://github.com/AlexeyAB/darknet/commit/d65909fbea471d06e52a2e4a41132380dc2edaa6)
30
26
31
-
* /usr/lib
32
-
* /usr/local/lib
27
+
Use provided [Makefile](Makefile).
33
28
34
-
Also, [darknet.h] should be available in one of the following locations:
29
+
* For CPU-based instalattion:
30
+
```shell
31
+
make install
32
+
```
33
+
* For both CPU and GPU-based instalattion:
34
+
```shell
35
+
make install_gpu
36
+
```
37
+
Note: If you want to have GPU-acceleration before running command above install [CUDA](https://developer.nvidia.com/cuda-downloads) and [cuDNN](https://developer.nvidia.com/cudnn) (Latest CUDA version I've tested is [10.2](https://developer.nvidia.com/cuda-10.2-download-archive) and cuDNN is [7.6.5](https://developer.nvidia.com/rdp/cudnn-archive#a-collapse765-102))
35
38
36
-
* /usr/include
37
-
* /usr/local/include
38
-
39
-
To achieve it, after Darknet compilation (via make) execute following command:
Note: you don't need *coco.data* file anymore, because sh-script above does insert *coco.names* into 'names' field in *yolov4.cfg* file (so AlexeyAB's fork can deal with it properly)
74
-
So last rows in yolov4.cfg file will look like:
75
-
```bash
76
-
......
77
-
[yolo]
78
-
.....
79
-
iou_loss=ciou
80
-
nms_kind=greedynms
81
-
beta_nms=0.6
82
-
83
-
names = coco.names # this is path to coco.names file
84
-
```
85
-
Also do not forget change batch and subdivisions sizes from:
86
-
```shell
87
-
batch=64
88
-
subdivisions=8
89
-
```
90
-
to
91
-
```shell
92
-
batch=1
93
-
subdivisions=1
94
-
```
95
-
It will reduce amount of VRAM used for detector test.
96
-
97
-
98
-
Build and run program
99
-
Yolo V4:
100
-
```shell
101
-
go build main.go && ./main --configFile=yolov4.cfg --weightsFile=yolov4.weights --imageFile=sample.jpg
* Note: you don't need *coco.data* file anymore, because sh-script above does insert *coco.names* into 'names' field in*yolov4.cfg* file (so AlexeyAB's fork can deal with it properly)
64
+
So last rows in yolov4.cfg file will look like:
65
+
```bash
66
+
......
67
+
[yolo]
68
+
.....
69
+
iou_loss=ciou
70
+
nms_kind=greedynms
71
+
beta_nms=0.6
72
+
73
+
names = coco.names # this is path to coco.names file
74
+
```
75
+
76
+
* Also do not forget change batch and subdivisions sizes from:
77
+
```shell
78
+
batch=64
79
+
subdivisions=8
80
+
```
81
+
to
82
+
```shell
83
+
batch=1
84
+
subdivisions=1
85
+
```
86
+
It will reduce amount of VRAM used for detector test.
87
+
88
+
89
+
* Build and run program
90
+
Yolo V4:
91
+
```shell
92
+
go build main.go && ./main --configFile=yolov4.cfg --weightsFile=yolov4.weights --imageFile=sample.jpg
0 commit comments