mirror of
https://github.com/LdDl/go-darknet.git
synced 2025-09-27 03:56:18 +08:00
docs
This commit is contained in:
13
.gitignore
vendored
13
.gitignore
vendored
@@ -1,9 +1,10 @@
|
|||||||
example/main
|
cmd/examples/main
|
||||||
example/coco.names
|
cmd/examples/base_example/main
|
||||||
example/yolov3.cfg
|
cmd/examples/coco.names
|
||||||
example/yolov3.weights
|
cmd/examples/yolov3.cfg
|
||||||
example/yolov4.cfg
|
cmd/examples/yolov3.weights
|
||||||
example/yolov4.weights
|
cmd/examples/yolov4.cfg
|
||||||
|
cmd/examples/yolov4.weights
|
||||||
darknet.h
|
darknet.h
|
||||||
*.so
|
*.so
|
||||||
predictions.png
|
predictions.png
|
||||||
|
12
README.md
12
README.md
@@ -64,13 +64,13 @@ go get github.com/LdDl/go-darknet
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Example Go program is provided in the [example] directory. Please refer to the code on how to use this Go package.
|
Example Go program is provided in the [examples] directory. Please refer to the code on how to use this Go package.
|
||||||
|
|
||||||
Building and running program:
|
Building and running program:
|
||||||
|
|
||||||
* Navigate to [example] folder
|
* Navigate to [examples] folder
|
||||||
```shell
|
```shell
|
||||||
cd $GOPATH/github.com/LdDl/go-darknet/example/base_example
|
cd ${YOUR PATH}/github.com/LdDl/go-darknet/cmd/examples
|
||||||
```
|
```
|
||||||
|
|
||||||
* Download dataset (sample of image, coco.names, yolov4.cfg (or v3), yolov4.weights(or v3)).
|
* Download dataset (sample of image, coco.names, yolov4.cfg (or v3), yolov4.weights(or v3)).
|
||||||
@@ -106,10 +106,10 @@ Building and running program:
|
|||||||
It will reduce amount of VRAM used for detector test.
|
It will reduce amount of VRAM used for detector test.
|
||||||
|
|
||||||
|
|
||||||
* Build and run program
|
* Build and run example program
|
||||||
Yolo V4:
|
Yolo V4:
|
||||||
```shell
|
```shell
|
||||||
go build main.go && ./main --configFile=yolov4.cfg --weightsFile=yolov4.weights --imageFile=sample.jpg
|
go build -o base_example/main base_example/main.go && ./base_example/main --configFile=yolov4.cfg --weightsFile=yolov4.weights --imageFile=sample.jpg
|
||||||
```
|
```
|
||||||
|
|
||||||
Output should be something like this:
|
Output should be something like this:
|
||||||
@@ -165,5 +165,5 @@ go-darknet follows [Darknet]'s [license].
|
|||||||
[darknet.h]: https://github.com/AlexeyAB/darknet/blob/master/include/darknet.h
|
[darknet.h]: https://github.com/AlexeyAB/darknet/blob/master/include/darknet.h
|
||||||
[include/darknet.h]: https://github.com/AlexeyAB/darknet/blob/master/include/darknet.h
|
[include/darknet.h]: https://github.com/AlexeyAB/darknet/blob/master/include/darknet.h
|
||||||
[Makefile]: https://github.com/alexeyab/darknet/blob/master/Makefile
|
[Makefile]: https://github.com/alexeyab/darknet/blob/master/Makefile
|
||||||
[example]: /example/base_example
|
[examples]: cmd/examples/base_example
|
||||||
[GoDoc]: https://godoc.org/github.com/LdDl/go-darknet
|
[GoDoc]: https://godoc.org/github.com/LdDl/go-darknet
|
||||||
|
@@ -4,12 +4,13 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
darknet "go-darknet"
|
||||||
"image"
|
"image"
|
||||||
"image/jpeg"
|
"image/jpeg"
|
||||||
"log"
|
"log"
|
||||||
"math"
|
"math"
|
||||||
"os"
|
"os"
|
||||||
darknet "github.com/LdDl/go-darknet"
|
|
||||||
"github.com/disintegration/imaging"
|
"github.com/disintegration/imaging"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -60,7 +61,7 @@ func main() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err.Error())
|
panic(err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
dr, err := n.Detect(imgDarknet)
|
dr, err := n.Detect(imgDarknet)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
printError(err)
|
printError(err)
|
@@ -11,7 +11,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/LdDl/go-darknet"
|
"go-darknet"
|
||||||
)
|
)
|
||||||
|
|
||||||
var configFile = flag.String("configFile", "",
|
var configFile = flag.String("configFile", "",
|
Before Width: | Height: | Size: 134 KiB After Width: | Height: | Size: 134 KiB |
1
go.mod
1
go.mod
@@ -3,7 +3,6 @@ module go-darknet
|
|||||||
go 1.17
|
go 1.17
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/LdDl/go-darknet v1.3.5
|
|
||||||
github.com/disintegration/imaging v1.6.2
|
github.com/disintegration/imaging v1.6.2
|
||||||
golang.org/x/image v0.0.0-20211028202545-6944b10bf410
|
golang.org/x/image v0.0.0-20211028202545-6944b10bf410
|
||||||
)
|
)
|
||||||
|
2
go.sum
2
go.sum
@@ -1,5 +1,3 @@
|
|||||||
github.com/LdDl/go-darknet v1.3.5 h1:oOMpWesW0+8ZLOdZcGS4LfjKKS48cHUceNrBy1MU7aM=
|
|
||||||
github.com/LdDl/go-darknet v1.3.5/go.mod h1:vNpwlxHd2mevaqWDYG9r/ABi1+cQrXw0HUuSPaDKuD8=
|
|
||||||
github.com/disintegration/imaging v1.6.2 h1:w1LecBlG2Lnp8B3jk5zSuNqd7b4DXhcjwek1ei82L+c=
|
github.com/disintegration/imaging v1.6.2 h1:w1LecBlG2Lnp8B3jk5zSuNqd7b4DXhcjwek1ei82L+c=
|
||||||
github.com/disintegration/imaging v1.6.2/go.mod h1:44/5580QXChDfwIclfc/PCwrr44amcmDAg8hxG0Ewe4=
|
github.com/disintegration/imaging v1.6.2/go.mod h1:44/5580QXChDfwIclfc/PCwrr44amcmDAg8hxG0Ewe4=
|
||||||
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||||
|
Reference in New Issue
Block a user