You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hmz007 70e34291f6
Rockchip Anroid14_SDK 20241219-rkr6 (2f87fee1)
1 year ago
..
app Rockchip Anroid14_SDK 20241219-rkr6 (2f87fee1) 1 year ago
gradle/wrapper Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 2 years ago
tools Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 2 years ago
.gitignore Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 2 years ago
README.md Rockchip Anroid14_SDK 20241219-rkr6 (2f87fee1) 1 year ago
README_CN.md Rockchip Anroid14_SDK 20241219-rkr6 (2f87fee1) 1 year ago
build.gradle Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 2 years ago
gradlew Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 2 years ago
gradlew.bat Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 2 years ago
settings.gradle Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 2 years ago

README.md

Introduction

  • rknn_yolov5_android_apk_demo is the one showing how to deploy yolov5s model on the android apk on RK3566_RK3568, RK3562 or RK3588

Pre-requisite

Structure

The demo can be split into two parts:

  • JAVA: com.rockchip.gpadc.demo: Reading camera inputs, and invoking jni interface to inferece and show the result

  • JNI: The interface for invoking rknnrt to do the inference of model.

Permission

This demo requires the permission of Camera and Read/Write permission for EXTERNAL_STORAGE

FAQ

Compiling error like“files found with path 'lib/arm64-v8a/xxx.so' from inputs:”

Execution failed for task ':app:mergeDebugNativeLibs'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.MergeNativeLibsTask$MergeNativeLibsTaskWorkAction
   > 2 files found with path 'lib/arm64-v8a/librga.so' from inputs:
      - rknpu2/examples/rknn_yolov5_android_apk_demo/app/build/intermediates/merged_jni_libs/debug/out/arm64-v8a/librga.so
      - rknpu2/examples/rknn_yolov5_android_apk_demo/app/build/intermediates/cxx/Debug/3f40b265/obj/arm64-v8a/librga.so
     If you are using jniLibs and CMake IMPORTED targets, see
     https://developer.android.com/r/tools/jniLibs-vs-imported-targets

* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

Alternatively,

2 files found with path 'lib/arm64-v8a/xxx.so' from inputs:
 - rknn_yolov5_android_apk_demo/app/build/intermediates/merged_jni_libs/debug/out/arm64-v8a/librga.so
 - rknn_yolov5_android_apk_demo/app/build/intermediates/cxx/Debug/3f40b265/obj/arm64-v8a/librga.so
If you are using jniLibs and CMake IMPORTED targets, see
https://developer.android.com/r/tools/jniLibs-vs-imported-targets

This requires add the "jniLibs.srcDirs = ['libs']" on app/build.gradle file “https://developer.android.com/r/tools/jniLibs-vs-imported-targets”

During launch apperrors like "E/SurfaceView: Exception configuring surface"

D/rkyolo: camera facing: 1
V/rkyolo: Camera Supported Preview Size = 160x90
V/rkyolo: Camera Supported Preview Size = 320x180
V/rkyolo: Camera Supported Preview Size = 432x240
V/rkyolo: Camera Supported Preview Size = 640x360
V/rkyolo: Camera Supported Preview Size = 800x448
V/rkyolo: Camera Supported Preview Size = 864x480
V/rkyolo: Camera Supported Preview Size = 1024x576
V/rkyolo: Camera Supported Preview Size = 1280x720
V/rkyolo: Camera Supported Preview Size = 1600x896
V/rkyolo: Camera Supported Preview Size = 1920x1080
E/SurfaceView: Exception configuring surface
    java.lang.RuntimeException: setParameters failed
        at android.hardware.Camera.native_setParameters(Native Method)
        at android.hardware.Camera.setParameters(Camera.java:2068)
        at com.rockchip.gpadc.demo.MainActivity.setCameraParameters(MainActivity.java:295)
        at com.rockchip.gpadc.demo.MainActivity.startCamera(MainActivity.java:245)
        at com.rockchip.gpadc.demo.MainActivity.access$300(MainActivity.java:47)
        at com.rockchip.gpadc.demo.MainActivity$TSurfaceHolderCallback.surfaceCreated(MainActivity.java:199)

This is casued by the unsupported camera resolution , modifying CAMERA_PREVIEW_WIDTH in "app/src/main/java/com/rockchip/gpadc/demo/rga/HALDefine.java" for supported resolution.