how to install coral usb accelerator for video stream use with csi camera raspberry pi 4 Bookworm

Sdílet
Vložit
  • čas přidán 28. 05. 2024
  • 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 github.com/google-coral/pycor...
    Download pycoral-2.0.0-cp39-cp39-linux_aarch64.whl and tflite_runtime-2.5.0.post1-cp39-cp39-linux_aarch64.whl from github.com/google-coral/pycor...
    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.
    wiki.veye.cc/index.php/V4L2_m... - gstreamer
    libcamera.org/getting-started...
    4. install mediamtx or other rtsp-server.
    github.com/bluenviron/mediamt... - 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

Komentáře • 2

  • @abelreybarreiros1425
    @abelreybarreiros1425 Před 29 dny

    I am trying to configure raspberry pi 4b with edge tpu silva (google coral for tflite models) but I am struggling because I am using python 3.9 in virtual env but I cant install picamera2 with pip. By the way the picamera2 package is native installed in my raspberry but I cannot use it for my scripts for ML purposes. As I have the Pi camera v3 model, I cannot use another library to obtain the image/video from my camera to use it with opencv or whatever. Can you help me or do you know some choice to use my camera with tflite and the Gcoral to apply my models ?

    • @user-os1xg1rh4c
      @user-os1xg1rh4c  Před 23 dny

      @@abelreybarreiros1425 better choice is to move to Bullseye. picamera2 based on libcamera and one’s should keep in mind that coral only supports python3.9 (the last version). in Bookworm python3.11 is native and only way there - use gstreamer or the something similar.