mirror of
https://github.com/LdDl/go-darknet.git
synced 2025-09-26 19:51:27 +08:00
Example Go application using go-darknet
This is an example Go application which uses go-darknet.
Install
go get github.com/LdDl/go-darknet
go install github.com/LdDl/go-darknet/example
# Alternatively
go build github.com/LdDl/go-darknet/example
An executable named example
should be in your $GOPATH/bin
, if using
go install
; otherwise it will be in your current working directory ($PWD
),
if using go build
.
Run
$GOPATH/bin/example
or
go run main.go -configFile=yolov3-320.cfg -dataConfigFile=coco.data -imageFile=sample.jpg -weightsFile=yolov3.weights
Please ensure that libdarknet.so
is in your $LD_LIBRARY_PATH
.
Notes
Note that the bounding boxes' values are ratios. To get the actual values, use the ratios and multiply with either the image's width or height, depending on which ratio is used.