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

[EdgeTPU Support]: coral error #4243

Closed
rafamaren opened this issue Nov 3, 2022 · 3 comments
Closed

[EdgeTPU Support]: coral error #4243

rafamaren opened this issue Nov 3, 2022 · 3 comments

Comments

@rafamaren
Copy link

Describe the problem you are having

hola,tras los problemas y errores que tenia en frigate con proxmox,decidi instalar debian 11 y tener frigate como contenedor docker. Ahora , una vez esta bien instalado, no reconoce coral, esta definido en detectors, tambien en en stacks.
Alguien me puede decir si debo añadir algo a debian para que me detecte coral bien?
La cpu no baja de 60%, incluso he quitado coral del intel nuc y aún asi la cpu sigue al 60%. En proxmox trabajaba con las mismas camaras en un 25% de cpu.

Version

11

Frigate config file

# ============MQTT==================================
mqtt:
  host: 192.168.----
  port: 1883
  user: ----
  password: ------
  topic_prefix: frigate
  client_id: frigate
#  stats_interval: 60

#=========DETECTORS===============================  
detectors:
  coral:
    type: edgetpu
    device: usb
    
#==========BIRDSEYE================================
birdseye: 
  enabled: True #--switch dirdseye--
  width: 1280
  height: 720
  quality: 8
# objects, visiona objeto rastreado en los últimos 30 segundos.
# motion, visiona movimientos detectados en los últimos 30 segundos.
# continuous, vision continua de todas las camaras.
  mode: continuous #--birdeye mode--

#==========FFMPEG=================================  
ffmpeg:
  hwaccel_args:
    - -hwaccel
    - vaapi
    - -hwaccel_device
    - /dev/dri/renderD128
    - -hwaccel_output_format
    - yuv420p
  input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 
  output_args: 
    detect: -f rawvideo -pix_fmt yuv420p
    record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v copy -c:a aac 
    rtmp: -c copy -f flv 
#==========DETECT================================
detect:
  width: 1280
  height: 720
  fps: 5
  max_disappeared: 25
  stationary: 
    interval: 0
    threshold: 50
    max_frames:
      default: 3000
      objects:
        person: 1000

#==========RECORD===============================
record: 
  retain:
    days: 0
    mode: motion
  events: # ---retencion de eventos---
    pre_capture: 5
    post_capture: 5
    objects:
      - cat
      - person
    retain:
      default: 1
      mode: active_objects

#========SNAPSHOTS==========================
snapshots: 
  timestamp: True
  bounding_box: True
  crop: True
  height: 540
  retain: # ----- retencion de fotos ---
    default: 1
    objects:
      person: 1
      cat: 10
#==========RTMP==========================
rtmp: 
  enabled: True
live:
  height: 720
  quality: 8

#==========TIMESTAMP===========================
timestamp_style: 
  # Opcional: Posicion de timestamp.
  # "tl" (top left), "tr" (top right), "bl" (bottom left), "br" (bottom right)
  position: "tr"
  format: "%d/%m/%Y %H:%M:%S"
  # Opcional: Color de la fuente
  color:
    # Todo Obligatorio cuando se especifica el color.
    red: 255
    green: 255
    blue: 255
  # Opcional: Espesor de la fuente.
  thickness: 2
  # Opcional: Efecto de las letras.
  #           None (sin efecto),
  #           "solid" (fondo sólido con color inverso a la fuente)
  #           "shadow" (sombras en la fuente)
  effect: 
#============CAMERAS=========================

#----------  CAM-1----------------------
cameras:
  portero:
    ffmpeg:
      inputs:
        - path: rtsp://-------:[email protected]:554/stream2
          roles:
            - detect
            - rtmp
        - path: rtsp://------:[email protected]:554/stream1
          roles:
            - record
    best_image_timeout: 60

#------------DETECT-------------------------
    detect: 
      enabled: True # -switch deteccion al inicio--
# --- resolucion para deteccion ---
#      width: 600
#      height: 360

#-----------RECORDS--------------------------
    record:
      enabled: True # -switch grabacion al inicio--
      expire_interval: 60
# -- objetos para eventos ----
      events: 
        objects:
          - person
#    --zonas para eventos--
        required_zones: []

#-----------SNAPSHOTS-----------------------
    snapshots: 
      enabled: True
# --zonas para fotos --
      required_zones: []

#-----------OBJECTS TRACKS-------------------
# Objetos para rastrear desde labelmap.txt
    objects:
      track:
        - person
      filters:
        person:
          threshold: 0.7

    motion:
      mask:
        - 0,0,997,0,626,720,0,720
        - 952,0,1002,0,906,431,751,407
        - 1173,0,1280,0,1280,720,932,720
        - 1280,720,1280,0,1104,0,935,720

#----------MQTT----------------------------
    mqtt: 
      enabled: True
      timestamp: True
      bounding_box: True
      crop: True
      height: 540
      quality: 70
# --- zonas para mqtt ---
      required_zones: []
      
#----------  CAM-3----------------------
  TERRAZA:
    ffmpeg:
      inputs:
        - path: rtsp://-----:[email protected]:554/cam/realmonitor?channel=1&subtype=0
          roles:
            - detect
            - rtmp
        - path: rtsp://------:[email protected]:554/cam/realmonitor?channel=1&subtype=1
          roles:
            - record
    best_image_timeout: 60

#------------DETECT-------------------------
    detect: 
      enabled: False # -switch deteccion al inicio--
# --- resolucion para deteccion ---
#      width: 1280
#      height: 720

#-----------RECORDS--------------------------
    record:
      enabled: True # -switch grabacion al inicio--
      expire_interval: 60
# -- objetos para eventos ----
      events: 
        objects:
          - person
          - cat
#    --zonas para eventos--
        required_zones: []

#-----------SNAPSHOTS-----------------------
    snapshots: 
      enabled: True
# --zonas para fotos --
      required_zones: []

#-----------OBJECTS TRACKS-------------------
# Objetos para rastrear desde labelmap.txt
    objects:
      track:
        - person
        - cat
      filters:
        person:
          threshold: 0.7
    motion:
       mask:
         - 176,201,274,205,280,137,185,127
#----------MQTT----------------------------
    mqtt: 
      enabled: True
      timestamp: True
      bounding_box: True
      crop: True
      height: 540
      quality: 70
# --- zonas para mqtt ---
      required_zones: []
      
#----------  CAM-2----------------------
  GARAJE:
    ffmpeg:
      inputs:
        - path: rtsp://-----:[email protected]:554/cam/realmonitor?channel=1&subtype=0
          roles:
            - detect
            - rtmp
        - path: rtsp://-------:[email protected]:554/cam/realmonitor?channel=1&subtype=1
          roles:
            - record
    best_image_timeout: 60

#------------DETECT-------------------------
    detect: 
      enabled: True # -switch deteccion al inicio--
# --- resolucion para deteccion ---
#      width: 1280 
#      height: 720

#-----------RECORDS--------------------------
    record:
      enabled: True # -switch grabacion al inicio--
      expire_interval: 60
# -- objetos para eventos ----
      events: 
        objects:
          - person
#    --zonas para eventos--
        required_zones: []

#-----------SNAPSHOTS-----------------------
    snapshots: 
      enabled: True
# --zonas para fotos --
      required_zones: []

#-----------OBJECTS TRACKS-------------------
# Objetos para rastrear desde labelmap.txt
    objects:
      track:
        - person
      filters:
        person:
          threshold: 0.7

#----------MQTT----------------------------
    mqtt: 
      enabled: True
      timestamp: True
      bounding_box: True
      crop: True
      height: 540
      quality: 70
# --- zonas para mqtt ---
      required_zones: []

docker-compose file or Docker CLI command

version: "3.9"
services:
  frigate:
    container_name: frigate
    privileged: true # this may not be necessary for all setups
    restart: "unless-stopped"
    image: blakeblackshear/frigate:stable
    shm_size: "8gb" # update for your cameras based on calculation above
    devices:
      - /dev/bus/usb:/dev/bus/usb # passes the USB Coral, needs to be modified for other versions
      - /dev/dri/renderD128 # for intel hwaccel, needs to be updated for your hardware
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /config:/config/
      - /storage:/media/frigate
      - type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
        target: /tmp/cache
        tmpfs:
          size: 1000000000
    ports:
      - "5059:5000"
      - "1935:1935" # RTMP feeds
    environment:
      FRIGATE_RTSP_PASSWORD: "-----"

Relevant log output

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[2022-11-03 15:47:05] frigate.app                    INFO    : Starting Frigate (0.11.1-2eada21)
Starting migrations
[2022-11-03 15:47:05] peewee_migrate                 INFO    : Starting migrations
There is nothing to migrate
[2022-11-03 15:47:05] peewee_migrate                 INFO    : There is nothing to migrate
[2022-11-03 15:47:05] detector.coral                 INFO    : Starting detection process: 215
[2022-11-03 15:47:05] frigate.edgetpu                INFO    : Attempting to load TPU as usb
[2022-11-03 15:47:05] ws4py                          INFO    : Using epoll
[2022-11-03 15:47:05] frigate.app                    INFO    : Output process started: 217
[2022-11-03 15:47:05] frigate.app                    INFO    : Camera processor started for portero: 224
[2022-11-03 15:47:05] frigate.app                    INFO    : Camera processor started for TERRAZA: 226
[2022-11-03 15:47:05] frigate.app                    INFO    : Camera processor started for GARAJE: 227
[2022-11-03 15:47:05] frigate.app                    INFO    : Capture process started for portero: 229
[2022-11-03 15:47:05] frigate.app                    INFO    : Capture process started for TERRAZA: 230
[2022-11-03 15:47:05] frigate.app                    INFO    : Capture process started for GARAJE: 232
[2022-11-03 15:47:08] frigate.edgetpu                INFO    : TPU found
[2022-11-03 15:47:15] ws4py                          INFO    : Using epoll

Operating system

Debian

Install method

Docker Compose

Coral version

USB

Any other information that may be helpful

No response

@NickM-27
Copy link
Collaborator

NickM-27 commented Nov 3, 2022

Recommend reading #3860

If you can run top inside the container it will help show what process is using CPU resources.

@NickM-27
Copy link
Collaborator

NickM-27 commented Nov 3, 2022

Are all your cameras sub streams the same 720x1080?

@github-actions
Copy link

github-actions bot commented Dec 4, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

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

No branches or pull requests

2 participants