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

[SOLVED] Raspberry PI 4 64 Bit OS Raspbian Bullseye or Bookworm, Coral USB accelerator, classify_capture.py #112

Open
zoldaten opened this issue May 29, 2024 · 1 comment
Labels
comp:thirdparty Thirdparty related issues Hardware:USB Accelerator Coral USB Accelerator issues subtype:ubuntu/linux Ubuntu/Linux Build/installation issues type:others Issues not falling in bug, perfromance, support, build and install or feature

Comments

@zoldaten
Copy link

zoldaten commented May 29, 2024

Description

i got it working just want to share.

Click to expand!

Issue Type

Others

Operating System

Linux

Coral Device

USB Accelerator

Other Devices

Rapsberry Pi 4

Programming Language

Python 3.9

Relevant Log Output

1. usb coral need python 3.9. it doesnt support 3.11 which is native for Raspbian Bookworm.
one way - install python 3.9 with pyenv.
2. install coral packages inside python 3.9
see https://github.com/google-coral/pycoral/issues/140

Download pycoral-2.0.0-cp39-cp39-linux_aarch64.whl and tflite_runtime-2.5.0.post1-cp39-cp39-linux_aarch64.whl from https://github.com/google-coral/pycoral/releases/tag/v2.0.0
pip install ./pycoral-2.0.0-cp39-cp39-linux_aarch64.whl
pip install ./tflite_runtime-2.5.0.post1-cp39-cp39-linux_aarch64.whl

3. picamera2 will not work cause of lack libcamera. so the fast way - use gstreamer and build libcamera.
https://wiki.veye.cc/index.php/V4L2_mode_for_Raspberry_Pi#Source_code_cross_compilation - gstreamer
https://libcamera.org/getting-started.html

4. install mediamtx or other rtsp-server.
https://github.com/bluenviron/mediamtx?tab=readme-ov-file#standalone-binary  - just download binary for raspberry. and change it settings (this video shows how).

5.
start rtsp stream:
gst-launch-1.0 libcamerasrc !  "video/x-raw, format=(string)UYVY, width=(int)640, height=(int)480,framerate=30/1" ! videoscale ! videoconvert ! x264enc tune=zerolatency bitrate=500 speed-preset=superfast ! rtspclientsink location=rtsp://localhost:8554/mystream

start mediamtx:
./mediamtx

start classify from coral examples (python 3.9):
python classify.py

video - https://youtu.be/EA7_2qL3Iho
@google-coral-bot google-coral-bot bot added comp:thirdparty Thirdparty related issues Hardware:USB Accelerator Coral USB Accelerator issues subtype:ubuntu/linux Ubuntu/Linux Build/installation issues type:others Issues not falling in bug, perfromance, support, build and install or feature labels May 29, 2024
@zoldaten
Copy link
Author

also see with picamera2 - https://github.com/zoldaten/google_coral_usb_picamera2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:thirdparty Thirdparty related issues Hardware:USB Accelerator Coral USB Accelerator issues subtype:ubuntu/linux Ubuntu/Linux Build/installation issues type:others Issues not falling in bug, perfromance, support, build and install or feature
Projects
None yet
Development

No branches or pull requests

1 participant