-
Notifications
You must be signed in to change notification settings - Fork 415
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
Install object_detect_tf post processing stage #1214
base: master
Are you sure you want to change the base?
Conversation
tensorflow-lite from meta-neural-network currently only builds for 64-bit systems. Please let me know what I must add in a new commit to skip the build of tensorflow-lite for 32-bit systems (libcamera-apps will build just fine if tensorflow was requested by the user but not available in sysroot.) |
@@ -0,0 +1,4 @@ | |||
do_install:append () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still find this an issue that needs to be fixed in the actual layer. I'm not sure I understand the reasoning not to do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right this is a generic change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Obviously that is a generic change that is being discussed upstream. The reasoning behind having a bbappend with the fix in our layer is to document the issue in the meantime, while still providing a functional example to the users. I'm not sure if you noticed, but processing with tensorflow did not work until now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that the review is in progress, and it introduces some compile issues. Let's see how that settles upstream (see the symlink discussion). I want to avoid:
- introducing new issues while fixing this
- making sure that this gets cleaned up after upstream deals with it
The libcamera-apps project provides assets for various built-in, OpenCV or TensforFlow Lite post processing stages. Install them as part of the package. Signed-off-by: Vivien Didelot <[email protected]>
Install the object_detect_tf stage described in the official documentation: https://www.raspberrypi.com/documentation/computers/camera_software.html#object_detect_tf-stage With libcamera-apps compiled with tflite support, one is able to run the object detection model with e.g.: libcamera-still --post-process-file /usr/share/libcamera-apps/assets/object_detect_tf.json --lores-width 400 --lores-height 300 Signed-off-by: Vivien Didelot <[email protected]>
The tensorflow-lite_2.* recipe from meta-neural-network installs the library and pkg-config files as tensorflow2-lite*, because their users may use several versions of the same library. However packages such as libcamera-apps expect tensorflow-lite* files. While this is being discussed with the upstream meta-neural-network layer, adding a dynamic bbappend in meta-raspberrypi also helps documenting the support for this tensorflow-lite provider. Refs nnstreamer/meta-neural-network#85 Signed-off-by: Vivien Didelot <[email protected]>
The meta-neural-network provider for tensorflow-lite only builds on 64-bit systems. Set COMPATIBLE_MACHINE to skip the build on 32-bit variants of the Raspberry Pi SoC family. Signed-off-by: Vivien Didelot <[email protected]>
ae60230
to
29da28b
Compare
I've documented the upstream issue in the code and commit message and skipped the build on 32-bit systems (libcamera-apps builds fine when tflite isn't available in sysroot.) |
With this PR, one can add the meta-neural-network layer to their system, enable tensorflow support in libcamera-apps with e.g.:
and try object detection with the new libcamera-detect app or even
libcamera-still --post-process-file /usr/share/libcamera-apps/assets/object_detect_tf.json --lores-width 400 --lores-height 300
for example.(tested on raspberrypi4-64 with a Camera Module 3)