Ubuntu 20.04 LTS 在3588安卓主板上测试yolov8-1.0版本的yolov8n-seg模型

0. 创建虚拟环境

#!< 创建虚拟环境yolov8
$ sudo pip install virtualenv
$ sudo pip install virtualenvwrapper
$ mkvirtualenv yolov8 -p /usr/bin/python3.8

1. 将yolov8n-seg.pt转换为yolov8n-seg.onnx文件

#!< 创建项目目录yolov8-rknn并下载yolov8n-seg.pt模型文件
(yolov8) $ mkdir -p /home/tianzx/Github/yolov8-rknn/epbox/model/
(yolov8) $ cd /home/tianzx/Github/yolov8-rknn/epbox/model/
(yolov8) $ wget https://github.com/ultralytics/assets/releases/download/v8.1.0/yolov8n-seg.pt#!< 将yolov8n-seg.pt转换为yolov8n-seg.onnx
(yolov8) $ cd /home/tianzx/Github/yolov8-rknn/
(yolov8) $ git clone https://github.com/airockchip/ultralytics_yolov8.git
(yolov8) $ cd ultralytics_yolov8
(yolov8) $ vi ./ultralytics/cfg/default.yaml
model: /home/tianzx/Github/yolov8_rknn/epbox/model/yolov8n-seg.pt # (str, optional) path to model file, i.e. yolov8n.pt, yolov8n.yaml
(yolov8) $ export PYTHONPATH=./
(yolov8) $ python ./ultralytics/engine/exporter.py
......
Ultralytics YOLOv8.0.151 🚀 Python-3.8.10 torch-2.1.0+cu121 CPU ()
YOLOv8n-seg summary (fused): 195 layers, 3404320 parameters, 0 gradients, 12.6 GFLOPsPyTorch: starting from '/home/tianzx/Github/yolov8_rknn/epbox/model/yolov8n-seg.pt' with input shape (16, 3, 640, 640) BCHW and output shape(s) ((16, 64, 80, 80), (16, 80, 80, 80), (16, 1, 80, 80), (16, 32, 80, 80), (16, 64, 40, 40), (16, 80, 40, 40), (16, 1, 40, 40), (16, 32, 40, 40), (16, 64, 20, 20), (16, 80, 20, 20), (16, 1, 20, 20), (16, 32, 20, 20), (16, 32, 160, 160)) (6.7 MB)RKNN: starting export with torch 2.1.0+cu121...RKNN: feed /home/tianzx/Github/yolov8_rknn/epbox/model/yolov8n-seg.onnx to RKNN-Toolkit or RKNN-Toolkit2 to generate RKNN model.
Refer https://github.com/airockchip/rknn_model_zoo/tree/main/models/CV/object_detection/yolo
RKNN: export success ✅ 0.3s, saved as '/home/tianzx/Github/yolov8_rknn/epbox/model/yolov8n-seg.onnx' (13.0 MB)Export complete (2.2s)
Results saved to /home/tianzx/Github/yolov8_rknn/epbox/model
Predict:         yolo predict task=segment model=/home/tianzx/Github/yolov8_rknn/epbox/model/yolov8n-seg.onnx imgsz=640 
Validate:        yolo val task=segment model=/home/tianzx/Github/yolov8_rknn/epbox/model/yolov8n-seg.onnx imgsz=640 data=coco.yaml 
Visualize:       https://netron.app

2. 将yolov8n-seg.onnx转换为yolov8n-seg-3588.rknn

# 安装rknn-toolkit2
(yolov8) $ cd  /home/tianzx/Github/yolov8_rknn/
(yolov8) $ git clone https://github.com/airockchip/rknn-toolkit2.git --depth 1
(yolov8) $ cd rknn-toolkit2/rknn-toolkit2/
(yolov8) $ pip install -r packages/requirements_cp38-2.0.0b0.txt
(yolov8) $ pip install packages/rknn_toolkit2-2.0.0b0+9bab5682-cp38-cp38-linux_x86_64.whl#!< 3588 主板 只能使用v1.6.0版本  ☆☆☆☆☆ 
(yolov8) $ cd /home/tianzx/Github/yolov8_rknn
(yolov8) $ git clone -b v1.6.0 --depth=1 https://github.com/airockchip/rknn_model_zoo.git
(yolov8) $ cd rknn_model_zoo/examples/yolov8_seg/python
(yolov8) $ python convert.py /home/tianzx/Github/yolov8_rknn/epbox/model/yolov8n-seg.onnx rk3588 i8 /home/tianzx/Github/yolov8_rknn/epbox/model/yolov8n-seg-3588.rknn
I rknn-toolkit2 version: 2.0.0b0+9bab5682
--> Config model
done
--> Loading model
I It is recommended onnx opset 19, but your onnx model opset is 12!
I Model converted from pytorch, 'opset_version' should be set 19 in torch.onnx.export for successful convert!
I Loading : 100%|██████████████████████████████████████████████| 162/162 [00:00<00:00, 50331.65it/s]
done
--> Building model
W build: found outlier value, this may affect quantization accuracyconst name                        abs_mean    abs_std     outlier valuemodel.22.cv3.1.1.conv.weight      0.12        0.18        -12.310     
I GraphPreparing : 100%|████████████████████████████████████████| 183/183 [00:00<00:00, 8442.40it/s]
I Quantizating : 100%|████████████████████████████████████████████| 183/183 [00:05<00:00, 35.36it/s]
W build: The default input dtype of 'images' is changed from 'float32' to 'int8' in rknn model for performance!Please take care of this change when deploy rknn model with Runtime API!
W build: The default output dtype of '375' is changed from 'float32' to 'int8' in rknn model for performance!Please take care of this change when deploy rknn model with Runtime API!
W build: The default output dtype of 'onnx::ReduceSum_383' is changed from 'float32' to 'int8' in rknn model for performance!Please take care of this change when deploy rknn model with Runtime API!
W build: The default output dtype of '388' is changed from 'float32' to 'int8' in rknn model for performance!Please take care of this change when deploy rknn model with Runtime API!
W build: The default output dtype of '354' is changed from 'float32' to 'int8' in rknn model for performance!Please take care of this change when deploy rknn model with Runtime API!
W build: The default output dtype of '395' is changed from 'float32' to 'int8' in rknn model for performance!Please take care of this change when deploy rknn model with Runtime API!
W build: The default output dtype of 'onnx::ReduceSum_403' is changed from 'float32' to 'int8' in rknn model for performance!Please take care of this change when deploy rknn model with Runtime API!
W build: The default output dtype of '407' is changed from 'float32' to 'int8' in rknn model for performance!Please take care of this change when deploy rknn model with Runtime API!
W build: The default output dtype of '361' is changed from 'float32' to 'int8' in rknn model for performance!Please take care of this change when deploy rknn model with Runtime API!
W build: The default output dtype of '414' is changed from 'float32' to 'int8' in rknn model for performance!Please take care of this change when deploy rknn model with Runtime API!
W build: The default output dtype of 'onnx::ReduceSum_422' is changed from 'float32' to 'int8' in rknn model for performance!Please take care of this change when deploy rknn model with Runtime API!
W build: The default output dtype of '426' is changed from 'float32' to 'int8' in rknn model for performance!Please take care of this change when deploy rknn model with Runtime API!
W build: The default output dtype of '368' is changed from 'float32' to 'int8' in rknn model for performance!Please take care of this change when deploy rknn model with Runtime API!
W build: The default output dtype of '347' is changed from 'float32' to 'int8' in rknn model for performance!Please take care of this change when deploy rknn model with Runtime API!
I rknn building ...
I rknn buiding done.
done
--> Export rknn model
--> The RKNN model saved in: /home/tianzx/Github/yolov8_rknn/epbox/model/yolov8n-seg-3588.rknn
done

3. 测试onnx模型和rknn模型

3.1 测试onnx模型

(yolov8) $ cd /home/tianzx/Github/yolov8_rknn/
(yolov8) $ cd rknn_model_zoo/examples/yolov8_seg/python/
(yolov8) $ python yolov8_seg.py --model_path /home/tianzx/Github/yolov8_rknn/epbox/model/yolov8n-seg.onnx --img_show                     
/home/tianzx/Github/yolov8_rknn/rknn_model_zoo/py_utils/onnx_executor.py:12: FutureWarning: In the future `np.bool` will be defined as the corresponding NumPy scalar.if getattr(np, 'bool', False):
Model-/home/tianzx/Github/yolov8_rknn/epbox/model/yolov8n-seg.onnx is onnx model, starting val
infer 1/1IMG: bus.jpg
person @ (209 241 285 510) 0.867
bus  @ (95 137 558 440) 0.867
person @ (109 235 224 535) 0.842
person @ (476 232 560 520) 0.801

yolov8n-seg.onnx-detect

3.2 测试rknn模型

3588安卓主板如果要调用rknn模型,需要更新3588安卓主板内的 rknn_server 和 librknnrt.so 文件。

(yolov8) $ cd /home/tianzx/Github/yolov8_rknn/
(yolov8) $ cd rknn-toolkit2/rknpu2/
# 切换到 root 用户权限
(yolov8) $ adb root
# 挂载文件系统为可读写模式
(yolov8) $ adb remount
(yolov8) $ adb shell
rk3588_s:/ # cd /vendor/bin/
# 我这边3588安卓主板的rknn_server 和 librknnrt.so 均是1.5.0版本, arm64架构
rk3588_s:/ # cp rknn_server rknn_server.1.5.0
rk3588_s:/ # cd ../lib64
rk3588_s:/ # cp librknnrt.so librknnrt.so.1.5.0
rk3588_s:/ # exit
(yolov8) $ adb push runtime/Android/rknn_server/arm64/rknn_server /vendor/bin/
runtime/Android/rknn_server/arm64/rknn_server: 1 file pushed, 0 skipped. 227.7 MB/s (895216 bytes in 0.004s)
(yolov8) $ adb push runtime/Android/librknn_api/arm64-v8a/librknnrt.so /vendor/lib64/
runtime/Android/librknn_api/arm64-v8a/librknnrt.so: 1 file pushed, 0 skipped. 465.1 MB/s (7366800 bytes in 0.015s)
(yolov8) $ adb shell
rk3588_s:/ # chmod +x /vendor/bin/rknn_server
rk3588_s:/ # su
rk3588_s:/ # setenforce 0
rk3588_s:/ # /vendor/bin/rknn_server &                                                                                                                                                                             
[1] 3895
rk3588_s:/ # start rknn server, version:2.0.0b0 (18eacd0 build@2024-03-22T14:07:01)
rk3588_s:/ # exit
(yolov8) $ cd ~/Github/yolov8_rknn/rknn_model_zoo/examples/yolov8_seg/python
(yolov8) $ python yolov8_seg.py --model_path /home/tianzx/Github/yolov8_rknn/epbox/model/yolov8n-seg-3588.rknn --target rk3588 --img_show                            
I rknn-toolkit2 version: 2.0.0b0+9bab5682
--> Init runtime environment
adbd is already running as root
I target set by user is: rk3588
I Get hardware info: target_platform = rk3588, os = Android, aarch = aarch64
I Check RK3588 board npu runtime version
I Starting ntp or adb, target is RK3588
I Start adb...
I Connect to Device success!
I NPUTransfer: Starting NPU Transfer Client, Transfer version 2.1.0 (b5861e7@2020-11-23T11:50:36)
D RKNNAPI: ==============================================
D RKNNAPI: RKNN VERSION:
D RKNNAPI:   API: 2.0.0b0 (18eacd0 build@2024-03-22T06:07:59)
D RKNNAPI:   DRV: rknn_server: 2.0.0b0 (18eacd0 build@2024-03-22T14:07:01)
D RKNNAPI:   DRV: rknnrt: 2.0.0b0 (35a6907d79@2024-03-24T10:30:08)
D RKNNAPI: ==============================================
D RKNNAPI: Input tensors:
D RKNNAPI:   index=0, name=images, n_dims=4, dims=[1, 640, 640, 3], n_elems=1228800, size=1228800, w_stride = 0, size_with_stride = 0, fmt=NHWC, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.003922
D RKNNAPI: Output tensors:
D RKNNAPI:   index=0, name=375, n_dims=4, dims=[1, 64, 80, 80], n_elems=409600, size=409600, w_stride = 0, size_with_stride = 0, fmt=NCHW, type=INT8, qnt_type=AFFINE, zp=-55, scale=0.138304
D RKNNAPI:   index=1, name=onnx::ReduceSum_383, n_dims=4, dims=[1, 80, 80, 80], n_elems=512000, size=512000, w_stride = 0, size_with_stride = 0, fmt=NCHW, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.002873
D RKNNAPI:   index=2, name=388, n_dims=4, dims=[1, 1, 80, 80], n_elems=6400, size=6400, w_stride = 0, size_with_stride = 0, fmt=NCHW, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.003169
D RKNNAPI:   index=3, name=354, n_dims=4, dims=[1, 32, 80, 80], n_elems=204800, size=204800, w_stride = 0, size_with_stride = 0, fmt=NCHW, type=INT8, qnt_type=AFFINE, zp=26, scale=0.023277
D RKNNAPI:   index=4, name=395, n_dims=4, dims=[1, 64, 40, 40], n_elems=102400, size=102400, w_stride = 0, size_with_stride = 0, fmt=NCHW, type=INT8, qnt_type=AFFINE, zp=-40, scale=0.095424
D RKNNAPI:   index=5, name=onnx::ReduceSum_403, n_dims=4, dims=[1, 80, 40, 40], n_elems=128000, size=128000, w_stride = 0, size_with_stride = 0, fmt=NCHW, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.003418
D RKNNAPI:   index=6, name=407, n_dims=4, dims=[1, 1, 40, 40], n_elems=1600, size=1600, w_stride = 0, size_with_stride = 0, fmt=NCHW, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.003922
D RKNNAPI:   index=7, name=361, n_dims=4, dims=[1, 32, 40, 40], n_elems=51200, size=51200, w_stride = 0, size_with_stride = 0, fmt=NCHW, type=INT8, qnt_type=AFFINE, zp=32, scale=0.020263
D RKNNAPI:   index=8, name=414, n_dims=4, dims=[1, 64, 20, 20], n_elems=25600, size=25600, w_stride = 0, size_with_stride = 0, fmt=NCHW, type=INT8, qnt_type=AFFINE, zp=-43, scale=0.075364
D RKNNAPI:   index=9, name=onnx::ReduceSum_422, n_dims=4, dims=[1, 80, 20, 20], n_elems=32000, size=32000, w_stride = 0, size_with_stride = 0, fmt=NCHW, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.003874
D RKNNAPI:   index=10, name=426, n_dims=4, dims=[1, 1, 20, 20], n_elems=400, size=400, w_stride = 0, size_with_stride = 0, fmt=NCHW, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.003922
D RKNNAPI:   index=11, name=368, n_dims=4, dims=[1, 32, 20, 20], n_elems=12800, size=12800, w_stride = 0, size_with_stride = 0, fmt=NCHW, type=INT8, qnt_type=AFFINE, zp=26, scale=0.022538
D RKNNAPI:   index=12, name=347, n_dims=4, dims=[1, 32, 160, 160], n_elems=819200, size=819200, w_stride = 0, size_with_stride = 0, fmt=NCHW, type=INT8, qnt_type=AFFINE, zp=-119, scale=0.029378
done
Model-/home/tianzx/Github/yolov8_rknn/epbox/model/yolov8n-seg-3588.rknn is rknn model, starting val
W inference: The 'data_format' is not set, and its default value is 'nhwc'!IMG: bus.jpg
person @ (209 240 285 509) 0.868
bus  @ (94 137 557 439) 0.841
person @ (108 235 221 536) 0.829
person @ (475 233 560 521) 0.783

yolov8n-seg-3588.rknn-detect
查看3588安卓主板的基本信息,这里需要用到 adb 命令,需要自行安装,比如我这边系统的adb路径为: /home/tianzx/Android/Sdk/platform-tools/adb

(yolov8) $ cd /home/tianzx/Github/yolov8_rknn/
#!< 安卓主板返回数字
(yolov8) $ adb shell getprop ro.build.version.release
12
#!< 如果板端是 Android 系统,可以在计算机端执行以下命令查询系统架构:
# 该命令的输出信息参考如下,其中 arm64-v8a 表示 ARM 64 位架构、第八版本的 ABI。
(yolov8) $ adb shell getprop ro.product.cpu.abi 
arm64-v8a
#!< 查看RKNPU2驱动版本信息
# rknpu 0.8.8 20230428
(yolov8) $ adb shell
rk3588_s:/ # dmesg | grep -i rknpu
[    4.875203] RKNPU fdab0000.npu: Adding to iommu group 0
[    4.875369] RKNPU fdab0000.npu: RKNPU: rknpu iommu is enabled, using iommu mode
[    4.876734] RKNPU fdab0000.npu: can't request region for resource [mem 0xfdab0000-0xfdabffff]
[    4.876759] RKNPU fdab0000.npu: can't request region for resource [mem 0xfdac0000-0xfdacffff]
[    4.876777] RKNPU fdab0000.npu: can't request region for resource [mem 0xfdad0000-0xfdadffff]
[    4.877338] [drm] Initialized rknpu 0.8.8 20230428 for fdab0000.npu on minor 1
[    4.881011] RKNPU fdab0000.npu: RKNPU: bin=0
[    4.881195] RKNPU fdab0000.npu: leakage=8
[    4.881248] debugfs: Directory 'fdab0000.npu-rknpu' with parent 'vdd_npu_s0' already present!
[    4.889245] RKNPU fdab0000.npu: pvtm=855
[    4.894164] RKNPU fdab0000.npu: pvtm-volt-sel=2
[    4.895645] RKNPU fdab0000.npu: avs=0
[    4.895857] RKNPU fdab0000.npu: l=10000 h=85000 hyst=5000 l_limit=0 h_limit=800000000 h_table=0
[    4.907412] RKNPU fdab0000.npu: failed to find power_model node
[    4.907459] RKNPU fdab0000.npu: RKNPU: failed to initialize power model
[    4.907473] RKNPU fdab0000.npu: RKNPU: failed to get dynamic-coefficient
#!< 启动rknn_server服务
rk3588_s:/ # su
rk3588_s:/ # setenforce 0
rk3588_s:/ # /vendor/bin/rknn_server &
# 可以看到rknn_server已经更新版本为 2.0.0b0
rk3588_s:/ # start rknn server, version:2.0.0b0 (18eacd0 build@2024-03-22T14:07:01)
# 查询 librknnrt.so 库版本
# 64 位系统 [已更新64位librknnrt.so文件,版本信息为2.0.0b0
rk3588_s:/ # strings /vendor/lib64/librknnrt.so | grep -i "librknnrt version"
librknnrt version: 2.0.0b0 (35a6907d79@2024-03-24T10:30:08)
# 32 位系统 [未更新32位librknnrt.so文件,版本信息为1.5.0]
rk3588_s:/ # strings /vendor/lib/librknnrt.so | grep -i "librknnrt version"
librknnrt version: 1.5.0 (e6fe0c678@2023-05-25T08:09:02)

4. 3588安卓主板apk测试

(yolov8) $ cd /home/tianzx/Github/yolov8_rknn/rknn_model_zoo
#!< https://dl.google.com/android/repository/android-ndk-r19c-linux-x86_64.zip
(yolov8) $ export ANDROID_NDK_PATH=/home/tianzx/Android/Sdk/ndk/android-ndk-r19c/
(yolov8) $ chmod +x build-android.sh
(yolov8) $ ./build-android.sh -t rk3588 -a arm64-v8a -d yolov8_seg
===================================
BUILD_DEMO_NAME=yolov8_seg
BUILD_DEMO_PATH=examples/yolov8_seg/cpp
TARGET_SOC=rk3588
TARGET_ARCH=arm64-v8a
BUILD_TYPE=Release
ENABLE_ASAN=OFF
INSTALL_DIR=/home/tianzx/Github/yolov8_rknn/rknn_model_zoo/install/rk3588_android_arm64-v8a/rknn_yolov8_seg_demo
BUILD_DIR=/home/tianzx/Github/yolov8_rknn/rknn_model_zoo/build/build_rknn_yolov8_seg_demo_rk3588_android_arm64-v8a_Release
ANDROID_NDK_PATH=/home/tianzx/Android/Sdk/ndk/android-ndk-r19c/
===================================
-- Android: Targeting API '23' with architecture 'arm64', ABI 'arm64-v8a', and processor 'aarch64'
-- Android: Selected unified Clang toolchain
-- The C compiler identification is Clang 8.0.2
-- The CXX compiler identification is Clang 8.0.2
-- Check for working C compiler: /home/tianzx/Android/Sdk/ndk/android-ndk-r19c//toolchains/llvm/prebuilt/linux-x86_64/bin/clang
-- Check for working C compiler: /home/tianzx/Android/Sdk/ndk/android-ndk-r19c//toolchains/llvm/prebuilt/linux-x86_64/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /home/tianzx/Android/Sdk/ndk/android-ndk-r19c//toolchains/llvm/prebuilt/linux-x86_64/bin/clang++
-- Check for working CXX compiler: /home/tianzx/Android/Sdk/ndk/android-ndk-r19c//toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- 64bit
-- Found OpenCV: /home/tianzx/Github/yolov8_rknn/rknn_model_zoo/3rdparty/opencv/opencv-android-sdk-build (found version "3.4.5") 
-- OpenCV_DIR=/home/tianzx/Github/yolov8_rknn/rknn_model_zoo/examples/yolov8_seg/cpp/../../../3rdparty/opencv/opencv-android-sdk-build/sdk/native/jni/abi-arm64-v8a
-- OpenCV_LIBS=opencv_calib3dopencv_coreopencv_features2dopencv_imgcodecsopencv_imgproc
-- Configuring done
-- Generating done
-- Build files have been written to: /home/tianzx/Github/yolov8_rknn/rknn_model_zoo/build/build_rknn_yolov8_seg_demo_rk3588_android_arm64-v8a_Release
Scanning dependencies of target fileutils
Scanning dependencies of target imageutils
Scanning dependencies of target imagedrawing
[ 10%] Building C object utils.out/CMakeFiles/fileutils.dir/file_utils.c.o
[ 20%] Building C object utils.out/CMakeFiles/imageutils.dir/image_utils.c.o
[ 30%] Building C object utils.out/CMakeFiles/imagedrawing.dir/image_drawing.c.o
[ 40%] Linking C static library libfileutils.a
/home/tianzx/Github/yolov8_rknn/rknn_model_zoo/utils/image_utils.c:282:35: warning: passing 'const image_buffer_t *' to parameter of type 'image_buffer_t *' discards qualifiers[-Wincompatible-pointer-types-discards-qualifiers]int size = get_image_size(img);^~~
/home/tianzx/Github/yolov8_rknn/rknn_model_zoo/utils/image_utils.h:67:36: note: passing argument to parameter 'image' here
int get_image_size(image_buffer_t* image);^
/home/tianzx/Github/yolov8_rknn/rknn_model_zoo/utils/image_utils.c:626:15: warning: incompatible pointer types initializing 'char *' with an expression of type 'int *' [-Wincompatible-pointer-types]char* p_imcolor = &imcolor;^           ~~~~~~~~
[ 40%] Built target fileutils
[ 50%] Linking C static library libimagedrawing.a
[ 50%] Built target imagedrawing
2 warnings generated.
[ 60%] Linking C static library libimageutils.a
[ 60%] Built target imageutils
Scanning dependencies of target rknn_yolov8_seg_demo
[ 70%] Building CXX object CMakeFiles/rknn_yolov8_seg_demo.dir/rknpu2/yolov8_seg.cc.o
[ 80%] Building CXX object CMakeFiles/rknn_yolov8_seg_demo.dir/postprocess.cc.o
[ 90%] Building CXX object CMakeFiles/rknn_yolov8_seg_demo.dir/main.cc.o
/home/tianzx/Github/yolov8_rknn/rknn_model_zoo/examples/yolov8_seg/cpp/postprocess.cc:925:16: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]return "null";^
/home/tianzx/Github/yolov8_rknn/rknn_model_zoo/examples/yolov8_seg/cpp/postprocess.cc:933:12: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]return "null";^
2 warnings generated.
[100%] Linking CXX executable rknn_yolov8_seg_demo
[100%] Built target rknn_yolov8_seg_demo
[ 20%] Built target fileutils
[ 40%] Built target imageutils
[ 60%] Built target imagedrawing
[100%] Built target rknn_yolov8_seg_demo
Install the project...
-- Install configuration: "Release"
-- Installing: /home/tianzx/Github/yolov8_rknn/rknn_model_zoo/install/rk3588_android_arm64-v8a/rknn_yolov8_seg_demo/./rknn_yolov8_seg_demo
-- Installing: /home/tianzx/Github/yolov8_rknn/rknn_model_zoo/install/rk3588_android_arm64-v8a/rknn_yolov8_seg_demo/lib/librknnrt.so
-- Installing: /home/tianzx/Github/yolov8_rknn/rknn_model_zoo/install/rk3588_android_arm64-v8a/rknn_yolov8_seg_demo/model/bus.jpg
-- Installing: /home/tianzx/Github/yolov8_rknn/rknn_model_zoo/install/rk3588_android_arm64-v8a/rknn_yolov8_seg_demo/model/coco_80_labels_list.txt
-- Up-to-date: /home/tianzx/Github/yolov8_rknn/rknn_model_zoo/install/rk3588_android_arm64-v8a/rknn_yolov8_seg_demo/lib/librknnrt.so
-- Installing: /home/tianzx/Github/yolov8_rknn/rknn_model_zoo/install/rk3588_android_arm64-v8a/rknn_yolov8_seg_demo/lib/librga.so
The RKNN model can not be found in "/home/tianzx/Github/yolov8_rknn/rknn_model_zoo/install/rk3588_android_arm64-v8a/rknn_yolov8_seg_demo/model", please check!
(yolov8) $ cp ../epbox/model/yolov8n-seg-3588.rknn install/rk3588_android_arm64-v8a/rknn_yolov8_seg_demo/model/
(yolov8) $ ls -hl /home/tianzx/Github/yolov8_rknn/rknn_model_zoo/install/rk3588_android_arm64-v8a/rknn_yolov8_seg_demo/model/
total 4.7M
-rw-r--r-- 1 tianzx tianzx 178K 417 15:36 bus.jpg
-rw-r--r-- 1 tianzx tianzx  621 417 15:36 coco_80_labels_list.txt
-rw-rw-r-- 1 tianzx tianzx 4.6M 417 17:59 yolov8n-seg-3588.rknn
(yolov8) $ adb root
adbd is already running as root
(yolov8) $ adb remount
remount succeeded
(yolov8) $ adb push install/rk3588_android_arm64-v8a/rknn_yolov8_seg_demo /data/
install/rk3588_android_arm64-v8a/rknn_yolov8_seg_demo/: 6 files pushed, 0 skipped. 73.0 MB/s (30818071 bytes in 0.403s)
(yolov8) $ adb shell
rk3588_s:/ # cd data/rknn_yolov8_seg_demo/                                                                                                                                                                         
rk3588_s:/data/rknn_yolov8_seg_demo # export LD_LIBRARY_PATH=./lib
rk3588_s:/data/rknn_yolov8_seg_demo # ./rknn_yolov8_seg_demo model/yolov8n-seg-3588.rknn model/bus.jpg                                                                                                             
load lable ./model/coco_80_labels_list.txt
model input num: 1, output num: 13
input tensors:index=0, name=images, n_dims=4, dims=[1, 640, 640, 3], n_elems=1228800, size=1228800, fmt=NHWC, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.003922
output tensors:index=0, name=375, n_dims=4, dims=[1, 64, 80, 80], n_elems=409600, size=409600, fmt=NCHW, type=INT8, qnt_type=AFFINE, zp=-55, scale=0.138304index=1, name=onnx::ReduceSum_383, n_dims=4, dims=[1, 80, 80, 80], n_elems=512000, size=512000, fmt=NCHW, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.002873index=2, name=388, n_dims=4, dims=[1, 1, 80, 80], n_elems=6400, size=6400, fmt=NCHW, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.003169index=3, name=354, n_dims=4, dims=[1, 32, 80, 80], n_elems=204800, size=204800, fmt=NCHW, type=INT8, qnt_type=AFFINE, zp=26, scale=0.023277index=4, name=395, n_dims=4, dims=[1, 64, 40, 40], n_elems=102400, size=102400, fmt=NCHW, type=INT8, qnt_type=AFFINE, zp=-40, scale=0.095424index=5, name=onnx::ReduceSum_403, n_dims=4, dims=[1, 80, 40, 40], n_elems=128000, size=128000, fmt=NCHW, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.003418index=6, name=407, n_dims=4, dims=[1, 1, 40, 40], n_elems=1600, size=1600, fmt=NCHW, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.003922index=7, name=361, n_dims=4, dims=[1, 32, 40, 40], n_elems=51200, size=51200, fmt=NCHW, type=INT8, qnt_type=AFFINE, zp=32, scale=0.020263index=8, name=414, n_dims=4, dims=[1, 64, 20, 20], n_elems=25600, size=25600, fmt=NCHW, type=INT8, qnt_type=AFFINE, zp=-43, scale=0.075364index=9, name=onnx::ReduceSum_422, n_dims=4, dims=[1, 80, 20, 20], n_elems=32000, size=32000, fmt=NCHW, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.003874index=10, name=426, n_dims=4, dims=[1, 1, 20, 20], n_elems=400, size=400, fmt=NCHW, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.003922index=11, name=368, n_dims=4, dims=[1, 32, 20, 20], n_elems=12800, size=12800, fmt=NCHW, type=INT8, qnt_type=AFFINE, zp=26, scale=0.022538index=12, name=347, n_dims=4, dims=[1, 32, 160, 160], n_elems=819200, size=819200, fmt=NCHW, type=INT8, qnt_type=AFFINE, zp=-119, scale=0.029378
model is NHWC input fmt
model input height=640, width=640, channel=3
origin size=640x640 crop size=640x640
input image: 640 x 640, subsampling: 4:2:0, colorspace: YCbCr, orientation: 1
scale=1.000000 dst_box=(0 0 639 639) allow_slight_change=1 _left_offset=0 _top_offset=0 padding_w=0 padding_h=0
src width=640 height=640 fmt=0x1 virAddr=0x0xb400007585f0b000 fd=0
dst width=640 height=640 fmt=0x1 virAddr=0x0xb400007585ddc000 fd=0
src_box=(0 0 639 639)
dst_box=(0 0 639 639)
color=0x72
rga_api version 1.10.0_[2]
rknn_run
person @ (209 240 285 509) 0.868
bus @ (94 137 557 439) 0.841
person @ (108 235 221 536) 0.829
person @ (475 233 560 521) 0.783
write_image path: out.png width=640 height=640 channel=3 data=0xb400007585f0b000
rk3588_s:/data/rknn_yolov8_seg_demo # exit
(yolov8) $ adb pull /data/rknn_yolov8_seg_demo/out.png 
/data/rknn_yolov8_seg_demo/out.png: 1 file pulled, 0 skipped. 36.2 MB/s (692055 bytes in 0.018s)
(yolov8) $ pwd
/home/tianzx/Github/yolov8_rknn/rknn_model_zoo

3588-android-yolov8n-rknn-detect

5. 参考连接

  1. ultralytics_yolov8
  2. yolov8/README.md
  3. yolov8_seg/README.md
  4. rknn-toolkit2/issues/10

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/824580.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

虚拟机vm桥接模式linux(centos,ubuntu)联网

台式机网线 查看宿主机网络 编辑虚拟机—>虚拟网络编辑器–>更改设置 选择&#xff0c;确定 进入linux系统 输入ip addr找到自己的网卡 我的是eno16777736 centos&#xff1a; 编辑 HWADDR"00:0C:29:54:CE:B8" TYPE"Ethernet" BOOTPROTO"…

公网IP多少钱可以购买?

公网IP是指可以在全球范围内访问和识别的唯一IP地址。对于许多企业和个人用户来说&#xff0c;公网IP是实现远程访问、搭建服务器、建立安全连接等重要需求的基础。公网IP的获取并不是免费的&#xff0c;并且价格因供应商和地区而异。 现有公网IP市场 当前&#xff0c;市场上有…

博弈论和sg函数

Nim游戏 题目链接&#xff1a;Nim游戏 先说结论&#xff1a;假设n堆石子&#xff0c;石子数分别为a1,a2,a3.....&#xff0c;则当a1^a2^a3^...^an0时先手必败&#xff0c;否则先手必胜。 因为所表示的二进制位必定是成对出现的&#xff0c;根据性质 1 ^ 1 0 &#xff0c;0 …

深入理解 pytest Fixture 方法及其应用

当涉及到编写自动化测试时&#xff0c;测试框架和工具的选择对于测试用例的设计和执行非常重要。在Python 中&#xff0c;pytest是一种广泛使用的测试框架&#xff0c;它提供了丰富的功能和灵活的扩展性。其中一个很有用的功 能是fixture方法&#xff0c;它允许我们初始化测试环…

HTML5漫画风格个人介绍源码

源码介绍 HTML5漫画风格个人介绍源码&#xff0c;源码由HTMLCSSJS组成&#xff0c;记事本打开源码文件可以进行内容文字之类的修改&#xff0c;双击html文件可以本地运行效果&#xff0c;也可以上传到服务器里面&#xff0c;重定向这个界面 效果截图 源码下载 HTML5漫画风格…

设计模式———单例模式

单例也就是只能有一个实例&#xff0c;即只创建一个实例对象&#xff0c;不能有多个。 可能会疑惑&#xff0c;那我写代码的时候注意点&#xff0c;只new一次不就得了。理论上是可以的&#xff0c;但在实际中很难实现&#xff0c;因为你无法预料到后面是否会脑抽一下~~因此我们…

【Pytorch】Conv1d

conv1d 先看看官方文档 再来个简单的例子 import torch import numpy as np import torch.nn as nndata np.arange(1, 13).reshape([1, 4, 3]) data torch.tensor(data, dtypetorch.float) print("[data]:\n", data) conv nn.Conv1d(in_channels4, out_channels1…

启明智显应用分享|基于ESP32-S3方案的SC01PLUS彩屏与chatgpt融合应用DEMO

今天将带大家真实体验科技与智慧的完美融合——SC01PLUS与ChatGPT的深度融合DEMO效果呈现。 彩屏的清晰显示与ChatGPT的精准回答&#xff0c;将为我们带来前所未有的便捷与高效。 SC01PLUS是启明智显基于ESP32-S3打造的一款3.5寸480*320分辨率的彩屏产品&#xff0c;您可以看…

【Git】git命令大全(持续更新)

本文架构 0.描述git简介术语 1.常用命令2. 信息管理新建git库命令更改存在库设置获取当前库信息 3.工作空间相关将工作空间文件添加到缓存区&#xff08;增&#xff09;从工作空间中移除文件&#xff08;删&#xff09;撤销提交 4.远程仓库相关同步远程仓库分支 &#xff08;持…

高版本Android studio 使用Markdown无法预览(已解决)

目录 概述 解决方法 概述 本人升级Android studio 当前版本为Android Studio Jellyfish | 2023.3.1 RC 2导致Markdown无法预览。 我尝试了很多网上的方法都无法Markdown解决预览问题&#xff0c;包括升级插件、安装各种和Markdown相关的插件及使用“Choose Boot Java Runtim…

一文了解OCI标准、runC、docker、contianerd、CRI的关系

docker和contanerd都是流行的容器运行时&#xff08;container runtime&#xff09;&#xff1b;想讲清楚他们两之间的关系&#xff0c;让我们先从runC和OCI规范说起。 一、OCI标准和runC 1、OCI&#xff08;open container initiative&#xff09; OCI是容器标准化组织为了…

利用动态规划优化10年投资回报:策略、证明与算法分析

利用动态规划优化10年投资回报&#xff1a;策略、证明与算法分析 a. 存在最优投资策略的证明b. 最优子结构性质的证明c. 最优投资策略规划算法设计d. 新限制条款下最优子结构性质的证明 在面对投资策略规划问题时&#xff0c;我们的目标是在10年后获得最大的回报。Amalgamated投…

牛客 NC205 跳跃游戏(三)【中等 贪心 Java,Go,PHP】

题目 题目链接&#xff1a; https://www.nowcoder.com/practice/14abdfaf0ec4419cbc722decc709938b 思路 参考答案Java import java.util.*;public class Solution {/*** 代码中的类名、方法名、参数名已经指定&#xff0c;请勿修改&#xff0c;直接返回方法规定的值即可*** …

Go 单元测试之Mysql数据库集成测试

文章目录 一、 sqlmock介绍二、安装三、基本用法四、一个小案例五、Gorm 初始化注意点 一、 sqlmock介绍 sqlmock 是一个用于测试数据库交互的 Go 模拟库。它可以模拟 SQL 查询、插入、更新等操作&#xff0c;并且可以验证 SQL 语句的执行情况&#xff0c;非常适合用于单元测试…

基于SpringBoot+Vue社区医院服务平台(源码+文档+包运行)

一.系统概述 随着信息技术在管理上越来越深入而广泛的应用&#xff0c;管理信息系统的实施在技术上已逐步成熟。本文介绍了社区医院信息平台的开发全过程。通过分析社区医院信息平台管理的不足&#xff0c;创建了一个计算机管理社区医院信息平台的方案。文章介绍了社区医院信息…

如何在Linux CentOS部署宝塔面板并实现固定公网地址访问内网宝塔

文章目录 一、使用官网一键安装命令安装宝塔二、简单配置宝塔&#xff0c;内网穿透三、使用固定公网地址访问宝塔 宝塔面板作为建站运维工具&#xff0c;适合新手&#xff0c;简单好用。当我们在家里/公司搭建了宝塔&#xff0c;没有公网IP&#xff0c;但是想要在外也可以访问内…

QAnything部署Mac m1环境

本次安装时Qanything已经更新到了v1.3.3&#xff0c;支持纯python安装。安装过程比较简单&#xff0c;如下&#xff1a; QAnything/README_zh.md at qanything-python-v1.3.1 netease-youdao/QAnything GitHub 首先需要用Anaconda3创建隔离环境&#xff0c;简要说明下Anaco…

春藤实业启动SAP S/4HANA Cloud Public Edition项目,与工博科技携手数字化转型之路

3月11日&#xff0c;广东省春藤实业有限公司&#xff08;以下简称“春藤实业”&#xff09;SAP S/4HANA Cloud Public Edition&#xff08;以下简称“SAP ERP公有云”&#xff09;项目正式启动。春藤实业董事长陈董、联络协调项目经理慕总、内部推行项目经理陈总以及工博董事长…

酒店水电能源计量管理系统

酒店水电能源计量管理系统是一种针对酒店行业设计的能源管理系统&#xff0c;旨在实现对水电能源的计量、监测和管理。本文将从系统特点、构成以及带来的效益三个方面展开介绍。 系统特点 1.多元化计量&#xff1a;该系统能够对酒店内的水、电能源进行多元化计量&#xff0c;…

软件项目总体测试计划(Word原件2024)

一、 前言 &#xff08;一&#xff09; 背景 &#xff08;二&#xff09; 目的 &#xff08;三&#xff09; 测试目标 &#xff08;四&#xff09; 适用范围与读者对象 &#xff08;五&#xff09; 术语与缩写 二、 软件测试实施流程 &#xff08;一&#xff09; 测试工作总体流…