mirror of
https://github.com/LdDl/go-darknet.git
synced 2025-09-27 03:56:18 +08:00
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
df9804aa69 | ||
![]() |
68ad5efb35 | ||
![]() |
5e18d06f26 | ||
![]() |
ebf93ddfa6 | ||
![]() |
8bd8488c7f |
12
README.md
12
README.md
@@ -1,4 +1,8 @@
|
||||
[](https://godoc.org/github.com/LdDl/go-darknet)
|
||||
[](https://sourcegraph.com/github.com/LdDl/go-darknet?badge)
|
||||
[](https://goreportcard.com/report/github.com/LdDl/go-darknet)
|
||||
[](https://github.com/LdDl/go-darknet/releases)
|
||||
|
||||
|
||||
# go-darknet: Go bindings for Darknet (Yolo V4, Yolo V3)
|
||||
### go-darknet is a Go package, which uses Cgo to enable Go applications to use YOLO V4/V3 in [Darknet].
|
||||
@@ -19,7 +23,7 @@
|
||||
|
||||
## Requirements
|
||||
|
||||
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/08bc0c9373158da6c42f11b1359ca2c017cef1b5)
|
||||
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/9dc897d2c77d5ef43a6b237b717437375765b527)
|
||||
|
||||
In order to use go-darknet, `libdarknet.so` should be available in one of
|
||||
the following locations:
|
||||
@@ -34,7 +38,9 @@ Also, [darknet.h] should be available in one of the following locations:
|
||||
|
||||
To achieve it, after Darknet compilation (via make) execute following command:
|
||||
```shell
|
||||
sudo cp libdarknet.so /usr/lib/libdarknet.so && sudo cp include/darknet.h /usr/local/include/darknet.h
|
||||
# Copy *.so to /usr/lib + /usr/include (or /usr/local/lib + /usr/local/include)
|
||||
sudo cp libdarknet.so /usr/lib/libdarknet.so && sudo cp include/darknet.h /usr/include/darknet.h
|
||||
# sudo cp libdarknet.so /usr/local/lib/libdarknet.so && sudo cp include/darknet.h /usr/local/include/darknet.h
|
||||
```
|
||||
Note: do not forget to set LIBSO=1 in Makefile before executing 'make':
|
||||
```Makefile
|
||||
@@ -64,7 +70,7 @@ Download dataset (sample of image, coco.names, yolov4.cfg (or v3), yolov4.weight
|
||||
#for yolo v3
|
||||
./download_data_v3.sh
|
||||
```
|
||||
Note: you don't need *coco.data* file anymore, because sh-script above does insert *coco.names* into 'names' filed in *yolov4.cfg* file (so AlexeyAB's fork can deal with it properly)
|
||||
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)
|
||||
So last rows in yolov4.cfg file will look like:
|
||||
```bash
|
||||
......
|
||||
|
@@ -14,7 +14,7 @@ struct network_box_result perform_network_detect(network *n, image *img, int cla
|
||||
sized = resize_image(*img, n->w, n->h);
|
||||
}
|
||||
struct network_box_result result = { NULL };
|
||||
network_predict_ptr(n, sized.data);
|
||||
network_predict(*n, sized.data);
|
||||
int nboxes = 0;
|
||||
result.detections = get_network_boxes(n, img->w, img->h, thresh, hier_thresh, 0, 1, &result.detections_len, letter_box);
|
||||
if (nms) {
|
||||
|
Reference in New Issue
Block a user