Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RKMPP + RKNN? #1

Open
irjkf129 opened this issue Aug 2, 2023 · 2 comments
Open

RKMPP + RKNN? #1

irjkf129 opened this issue Aug 2, 2023 · 2 comments

Comments

@irjkf129
Copy link

irjkf129 commented Aug 2, 2023

Good afternoon I'm writing an application for real-time processing of car numbers, and for this I want to use rockchip-toolkit and rkmpp at the same time. But I don’t fully understand, is it possible to somehow take your two assemblies and combine them in order to use both rknn and rkmpp?

@milas
Copy link
Owner

milas commented Aug 11, 2023

You understand correct - there is no convenient way to use them together 😛

I would recommend doing a multistage build and then using the rkmpp Debian image as a base image for your app, which will have Gstreamer and rkmpp libraries in-place:

FROM <base image> AS build

RUN ... compile your app ...

FROM milas/rkmpp-debian:bullseye

COPY --link --from=build /out/your-app /
CMD ["/your-app"]

For rknn, if you only need the C library, I would add rockchip/rknpu2 as a Git submodule and use rknn_api.h & librknnrt.so from it.

You can also do it all from it in Docker:

# syntax=docker/dockerfile:1
FROM scratch AS git-rknpu2

ADD https://github.com/rockchip-linux/rknpu2.git /

milas/rkmpp-debian:bullseye

COPY --link --from=git-rknpu2 /runtime/RK3588/Linux/librknn_api/aarch64/*.so /usr/local/lib/
RUN ldconfig

# header file for compilation
COPY --link --from=git-rknpu2 /runtime/RK3588/Linux/librknn_api/include/*.h /usr/local/include/

I hope that's helpful 😅

If you want to see a more complete example, take a look at https://github.com/milas/rkoxide/blob/main/crates/rknn-demo/Dockerfile

@irjkf129
Copy link
Author

Hello!
I tried building on milas/rkmpp-debian:bullseye and installing python3.8-dev on top of it, and it seemed to work.
I haven't tested with GStreamer yet, but rknn model works!
Perhaps there will be some problems.
Is it worth keeping up to date on progress, will it be useful to you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants