Code Monkey home page Code Monkey logo

rknn-multi-threaded-3588's Introduction

rknn-multi-threaded-3588

RKNN Multi threades for Orange Pi 5, 5B and 5 Plus

This is a copy (not forked) from this github https://github.com/leafqycc/rknn-multi-threaded

I've modified some files to use it on Orange Pi 5, 5B and 5 Plus

Depend on your Python version, you need to download the RKNN Toolkit Lite 2 from this https://github.com/rockchip-linux/rknn-toolkit2 Included in this github is the wheel version 1.5.2 for Python 3.9. Install it by typing command

pip install rknn_toolkit_lite2-1.5.2-cp39-cp39-linux_aarch64.whl

Maybe you also need to copy the file librknnrt.so to /usr/lib too, and install opencv module

pip install opencv-python

Check your Camera used in /dev/video0 or /dev/video1, and edit the code in main.py to the corresponance camera

cap = cv2.VideoCapture(0)

then run

python main.py

If you want to increase image size, edit this line in func.py

OBJ_THRESH, NMS_THRESH, IMG_SIZE = 0.25, 0.45, 640

or number of frame, edit this on main.py

TPEs = 3

The rkcat.sh can be running with

sudo bash rkcat.sh

to check the NPU performance

Here is demo i run on Orange Pi 5 PLus with HDMI In

orangepi5plus

Acknowledgements

rknn-multi-threaded-3588's People

Contributors

thanhtantran avatar

Stargazers

DanielYong avatar Ihor Olkhovatyi avatar  avatar zhangliang avatar  avatar Nazar Zdorovylo avatar  avatar  avatar  avatar nnnnnnnn avatar Robotics Weekends avatar Matjaz Muhic avatar Antonio Maximiano avatar AJAY SAHU avatar yan avatar Walter Arca Yi avatar  avatar  avatar  avatar  avatar Valentyn Korniienko avatar Ruslan avatar Mason McManus avatar NguyenKhoa avatar GIO E avatar Keannu Bernasol avatar

Watchers

 avatar

Forkers

sheremet almnet

rknn-multi-threaded-3588's Issues

Can not run custom model

Hi, have a problem - when start my own custom rknn model have a trouble, when i start one of models - File "/home/orangepi/Desktop/rknn/rknn-multi-threaded-3588/func.py", line 208, in myFunc
input1_data = outputs[1].reshape([3, -1]+list(outputs[1].shape[-2:]))
IndexError: list index out of range

and if start another model - File "/home/orangepi/Desktop/rknn/rknn-multi-threaded-3588/func.py", line 207, in myFunc
input0_data = outputs[0].reshape([10, -1]+list(outputs[0].shape[-2:]))
ValueError: cannot reshape array of size 2142000 into shape (10,newaxis,25200,85)

help please, think thats problem with model which i converted in onnx and then in rknn (first native yolo library for onnx, than rknn_model_zoo for rknn converting)

'NoneType' object is not subscriptable

File "/home/orangepi/rknn-multi-threaded-3588/func.py", line 206, in myFunc
input0_data = outputs[0].reshape([3, -1]+list(outputs[0].shape[-2:]))
TypeError: 'NoneType' object is not subscriptable

How to solve the problem? I am using python 3.10, Ubuntu 22.04, and USB Camera in Orange Pi 5.

Thank you

E RKNN: [22:09:41.479] failed to submit!, op id: 1, op name: Conv:Conv_0,

Changing the value of TPEs in main.py to 1 results in the functionality working with 20 frames per second (fps) but poor quality of recognition and warning messages are observed:

W RKNN: [22:06:38.699] Output(285): size_with_stride larger than model origin size, if need run OutputOperator in NPU, please call rknn_create_memory using size_with_stride.

However, when TREs is set to 2 or TPEs to 3, an error occurs:

E RKNN: [22:09:41.479] failed to submit!, op id: 1, op name: Conv:Conv_0, flags: 0x5, task start: 0, task number: 196, run task counter: 0, int status: 0, please try updating to the latest version of the toolkit2 and runtime from: https://eyun.baidu.com/s/3eTDMk6Y (PWD: rknn)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.