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

news2024/11/28 20:33:22

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 GFLOPs

PyTorch: 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 accuracy
                        const name                        abs_mean    abs_std     outlier value
                        model.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/1

IMG: 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.138304
  index=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.002873
  index=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.003169
  index=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.023277
  index=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.095424
  index=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.003418
  index=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.003922
  index=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.020263
  index=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.075364
  index=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.003874
  index=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.003922
  index=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.022538
  index=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.coloradmin.cn/o/1603456.html

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

相关文章

【网络安全 | 密码学】JWT基础知识及攻击方式详析

前言 JWT&#xff08;Json Web Token&#xff09;是一种用于在网络应用之间安全地传输信息的开放标准。它通过将用户信息以JSON格式加密并封装在一个token中&#xff0c;然后将该token发送给服务端进行验证&#xff0c;从而实现身份验证和授权。 流程 JWT的加密和解密过程如…

【C++类和对象】拷贝构造与赋值运算符重载

&#x1f49e;&#x1f49e; 前言 hello hello~ &#xff0c;这里是大耳朵土土垚~&#x1f496;&#x1f496; &#xff0c;欢迎大家点赞&#x1f973;&#x1f973;关注&#x1f4a5;&#x1f4a5;收藏&#x1f339;&#x1f339;&#x1f339; &#x1f4a5;个人主页&#x…

通过excel获取网站的数据信息

通过excel获取网站的数据信息&#xff0c;有时候网站数据的表格很多数据&#xff0c;需要梳理到表格中&#xff0c;如何用excel表格直接读取网站数据 备注问题&#xff1a;表格内容有时候在一行&#xff0c;很长&#xff0c;不方便处理 bug问题&#xff1a;不要多选&#xff0…

鸢尾花数据集分类(决策树,朴素贝叶斯,人工神经网络)

目录 一、决策树 二、朴素贝叶斯 三、人工神经网络 四、利用三种方法进行鸢尾花数据集分类 一、决策树 决策树是一种常用的机器学习算法&#xff0c;用于分类和回归任务。它是一种树形结构&#xff0c;其中每个内部节点表示一个特征或属性&#xff0c;每个分支代表这个特征…

元宇宙-虚拟世界的安全风险如何应对

元宇宙&#xff08;Metaverse&#xff09;是一个虚拟时空间的集合&#xff0c;由一系列的增强现实&#xff08;AR&#xff09;、虚拟现实&#xff08;VR&#xff09;和互联网&#xff08;Internet&#xff09;所组成。这个虚拟时空间是一个持续存在的、由众多虚拟世界互相连接而…

深度Q-Learning在算法交易中的应用

一、说明 在《华尔街的随机漫步》一书中&#xff0c;作者伯顿马尔基尔&#xff08;Burton G. Malkiel&#xff09;声称&#xff1a;“一只蒙着眼睛的猴子向报纸的财经版面投掷飞镖&#xff0c;可以选择一个与专家精心挑选的投资组合一样好的投资组合。 如果我们让巴甫洛夫的狗接…

Vue3从入门到实战:深度掌握组件通信(上部曲)

props的概念&#xff1a; 当你使用Vue 3的组合式API时&#xff0c;props就是一种让你可以从父组件向子组件传递数据的方式。你可以想象成你在给子组件写一封信&#xff0c;把需要传递的信息放在信封里。 在Vue 3中&#xff0c;你可以在子组件的代码中定义props&#xff0c;就…

javaWeb项目-校园交友网站功能介绍

项目关键技术 开发工具&#xff1a;IDEA 、Eclipse 编程语言: Java 数据库: MySQL5.7 框架&#xff1a;ssm、Springboot 前端&#xff1a;Vue、ElementUI 关键技术&#xff1a;springboot、SSM、vue、MYSQL、MAVEN 数据库工具&#xff1a;Navicat、SQLyog 1、Java语言 Java语…

HTML部分常用标签补充

table&#xff08;布局方面不建议使用&#xff0c;而是使用CSS来完成&#xff09;: 标签解释&#xff1a; ~table标签顾名思义&#xff0c;是表格的意思 ~table其中可以使用boder属性来显示表格的线&#xff0c;最好使用CSS来配合HTML的使用 ~table内的内容可以使用colspan来定…

2024运营级租房源码管理PHP后台+uniapp前端(app+小程序+H5)

内容目录 一、详细介绍二、效果展示1.部分代码2.效果图展示 一、详细介绍 房产系统 一款基于ThinkPHPUniapp开发的房产管理系统&#xff0c;支持小程序、H5、APP&#xff1b;包含房客、房东、经纪人三种身份。核心功能有&#xff1a;新盘销售、房屋租赁、地图找房、房源代理、…

数据结构(七)——B树和B+树

7.4.1_1 B树 5叉查找树 //5叉排序树的结点定义 struct Node {ElemType keys[4]; //最多4个关键字struct Node &child[5]; //最多5个孩子int num; //结点中有几个关键字 }; 如何保证查找效率&#xff1f; eg:对于5叉排序树&#xff0c;规定…

AWS Key disabler:AWS IAM用户访问密钥安全保护工具

关于AWS Key disabler AWS Key disabler是一款功能强大的AWS IAM用户访问密钥安全保护工具&#xff0c;该工具可以通过设置一个时间定量来禁用AWS IAM用户访问密钥&#xff0c;以此来降低旧访问密钥所带来的安全风险。 工具运行流程 AWS Key disabler本质上是一个Lambda函数&…

aws云靶场和一些杂记

aws靶场 在AWS靶场中&#xff0c;存在三个安全问题&#xff1a;1) 一个S3存储桶政策配置错误&#xff0c;允许公共访问&#xff0c;通过访问特定域名可获取flag。2) SQS消息队列的政策没有限制角色&#xff0c;允许发送和接收消息&#xff0c;通过aws sqs命令行工具的receive-…

java八股文知识点讲解(个人认为讲的比较好的)

1、解决哈希冲突——链地址法&#xff1a;【第7章查找】19哈希表的查找_链地址法解决哈希冲突_哔哩哔哩_bilibili 2、解决哈希冲突——开放地址法 &#xff1a; 【第7章查找】18哈希表的查找_开放定址法解决哈希冲突_哔哩哔哩_bilibili 3、小根堆大根堆的创建&#xff1a;选择…

MR-JE-70A 三菱MR-JE伺服驱动器(750W通用型)

三菱MR-JE伺服驱动器(750W通用型) MR-JE-70A外部连接,MR-JE-70A用户手册,MR-JE-70A 三相或单相AC220V三菱通用型伺服放大器750W&#xff0c;配套电机HG-SN52J-S100、HG-KN73J-S100。 MR-JE-70A参数说明&#xff1a;伺服驱动器通用型750W&#xff0c;三相或单相AC200V~240V 三…

reportlab 生成pdf文件 (python)

1 安装 pip install reportlab2 应用场景 通过网页动态生成PDF文档大量的报告和数据发布用XML一步生成PDF 官网案例 3 PLATYPUS Platypus是“Page Layout and Typography Using Scripts”&#xff0c;是使用脚本的页面布局和印刷术的缩写&#xff0c;这是一个高层次页面布局…

媒体邀约的好处?怎么邀请媒体?

传媒如春雨&#xff0c;润物细无声&#xff0c;大家好&#xff0c;我是51媒体网胡老师。 媒体邀约的好处主要体现在提高品牌知名度、扩大受众群体以及与媒体建立良好的合作关系。 媒体邀约是一种有效的公关策略&#xff0c;通过吸引媒体关注来促进信息的传播。它可以帮助组织…

【笔记】vscode debug进入site-packages包源码

选择左侧栏第三个图标&#xff0c;点击创建 launch.json 文件 选择 Python Debugger 选择Python文件 这里可以看到launch.json 文件 在configurations中添加键值对 "justMyCode": false在文件中打上断点&#xff0c;点击"三角符"号开始调试 按F11或者红框…

双向链表也叫双链表

双向链表也叫双链表 双向链表也叫双链表 每个节点都有两个指针&#xff0c;分别指向 直接前驱节点、直接后继节点 双向链表中任意一个节点&#xff0c;都可以通过通过它的前驱节点和后继节点&#xff0c;访问其他节点 节点如下 节点定义 ListNode // 节点的值 T element; /…

day12-1 | 二叉树 part-1 (Go) | 二叉树的理论基础

今日任务 二叉树的理论基础 ( 参考: 代码随想录) 二叉树种类 二叉树是一种基础数据结构&#xff0c;在算法面试中都是常客&#xff0c;也是众多数据结构的基石。二叉树的定义 和链表是差不多的&#xff0c;相对于链表 &#xff0c;二叉树的节点里多了一个指针&#xff0c; 有…