mirror of
https://github.com/swdee/go-rknnlite.git
synced 2026-04-22 22:57:03 +08:00
modified docker command to run from project root, so go mod is not required in examples
This commit is contained in:
+5
-5
@@ -38,17 +38,17 @@ You can use this image to run your own application or the go-rknnlite examples.
|
||||
to run the [MobileNet Demo](example/mobilenet) use the following commands.
|
||||
|
||||
```
|
||||
cd example/mobilenet
|
||||
# from project root directory
|
||||
|
||||
docker run --rm \
|
||||
--device /dev/dri:/dev/dri \
|
||||
-v "$(pwd):/go/src/app" \
|
||||
-v "$(pwd)/../data:/go/src/data" \
|
||||
-v "$(pwd)/example/data:/go/src/data" \
|
||||
-v "/usr/include/rknn_api.h:/usr/include/rknn_api.h" \
|
||||
-v "/usr/lib/librknnrt.so:/usr/lib/librknnrt.so" \
|
||||
-w /go/src/app \
|
||||
swdee/go-rknnlite:latest \
|
||||
go run mobilenet.go
|
||||
go run ./example/mobilenet/mobilenet.go
|
||||
```
|
||||
|
||||
An explanation of each parameter in the docker command is as follows;
|
||||
@@ -57,12 +57,12 @@ An explanation of each parameter in the docker command is as follows;
|
||||
|------------------------------------------------------|-----------------------------------------------------------------|
|
||||
| --device /dev/dri:/dev/dri | Pass the NPU device through into the container |
|
||||
| -v "$(pwd):/go/src/app" | Mount the current Go application source code into the container |
|
||||
| -v "$(pwd)/../data:/go/src/data" | Mount the example/data files into the container |
|
||||
| -v "$(pwd)/example/data:/go/src/data" | Mount the example/data files into the container |
|
||||
| -v "/usr/include/rknn_api.h:/usr/include/rknn_api.h" | Include the rknn-toolkit2 header files |
|
||||
| -v "/usr/lib/librknnrt.so:/usr/lib/librknnrt.so" | Include the rknn-toolkit2 shared library |
|
||||
| -w /go/src/app | Set the working directory in docker container |
|
||||
| swdee/go-rknnlite:latest | Use the prebuilt go-rknnlite docker image |
|
||||
| go run mobilenet.go | Run the mobilenet.go demo |
|
||||
| go run ./example/mobilenet/mobilenet.go | Run the mobilenet.go demo |
|
||||
|
||||
|
||||
To view the OpenCV configuration in this prebuilt docker image run.
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
module mobilenet
|
||||
|
||||
go 1.22.8
|
||||
|
||||
require (
|
||||
github.com/swdee/go-rknnlite v0.0.0-20250401212925-399f18c77ec7
|
||||
gocv.io/x/gocv v0.41.0
|
||||
)
|
||||
@@ -1,4 +0,0 @@
|
||||
github.com/swdee/go-rknnlite v0.0.0-20250401212925-399f18c77ec7 h1:l9IeY+65tm/QYa5wwcasSznwqj+EpC6br7oxHtnbZzE=
|
||||
github.com/swdee/go-rknnlite v0.0.0-20250401212925-399f18c77ec7/go.mod h1:/qJ6ExxC28AARBXGFDWTcjq4A6e6EDhw1IQm9x3sUJ0=
|
||||
gocv.io/x/gocv v0.41.0 h1:KM+zRXUP28b6dHfhy+4JxDODbCNQNtLg8kio+YE7TqA=
|
||||
gocv.io/x/gocv v0.41.0/go.mod h1:zYdWMj29WAEznM3Y8NsU3A0TRq/wR/cy75jeUypThqU=
|
||||
Reference in New Issue
Block a user