blakeblackshear / frigate

NVR with realtime local object detection for IP cameras
https://frigate.video
MIT License
18.59k stars 1.69k forks source link

[Detector Support]: Intel Myriad VPU [Movidius Neural Compute Stick] v1 #6711

Closed Pirionfr closed 1 year ago

Pirionfr commented 1 year ago

Describe the problem you are having

I have an Intel NCS Myriad stick not a NCS2 I'm trying to make it work by following the doc here on my rpi4 but I get this error "RuntimeError: Failed to allocate graph: MYRIAD device is not opened"

in the udev rules I added : SUBSYSTEM=="usb", ATTRS{idProduct}=="2150", ATTRS{idVendor}=="03e7", GROUP="users", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1"

someone can help me ?

Version

0.12

Frigate config file

ffmpeg:
  hwaccel_args: preset-rpi-64-h264

detectors:
  ncs:
    type: openvino
    device: MYRIAD
    model:
      path: /openvino-model/ssdlite_mobilenet_v2.xml

model:
  width: 300
  height: 300
  input_tensor: nhwc
  input_pixel_format: bgr
  labelmap_path: /openvino-model/coco_91cl_bkgr.txt

cameras:
  garage:
    ffmpeg:
      inputs:
        - path: rtsp://....
          roles:
            - detect
    detect:
      width: 1280
      height: 720

docker-compose file or Docker CLI command

version: "3.9"
services:
  frigate:
    container_name: frigate
    privileged: true
    restart: unless-stopped
    image:  ghcr.io/blakeblackshear/frigate:stable
    shm_size: "128mb"
    volumes:
      - /dev/bus/usb:/dev/bus/usb
      - /etc/localtime:/etc/localtime:ro
      - /etc/frigate/config.yml:/config/config.yml
      - /opt/fregate/storage:/media/frigate
      - type: tmpfs 
        target: /tmp/cache
        tmpfs:
          size: 1000000000
    ports:
      - "5000:5000"
      - "8554:8554" # RTSP feeds
      - "8555:8555/tcp" # WebRTC over tcp
      - "8555:8555/udp" # WebRTC over udp
    environment:
      FRIGATE_RTSP_PASSWORD: "password"
    device_cgroup_rules:
      - "c 189:* rmw"

Relevant log output

frigate  | 2023-06-05 23:39:17.533422776  Process detector:ncs:
frigate  | 2023-06-05 23:39:17.536884681  Traceback (most recent call last):
frigate  | 2023-06-05 23:39:17.536951440    File "/usr/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
frigate  | 2023-06-05 23:39:17.536954644      self.run()
frigate  | 2023-06-05 23:39:17.536957755    File "/usr/lib/python3.9/multiprocessing/process.py", line 108, in run
frigate  | 2023-06-05 23:39:17.536960273      self._target(*self._args, **self._kwargs)
frigate  | 2023-06-05 23:39:17.537029273    File "/opt/frigate/frigate/object_detection.py", line 98, in run_detector
frigate  | 2023-06-05 23:39:17.537127402      object_detector = LocalObjectDetector(detector_config=detector_config)
frigate  | 2023-06-05 23:39:17.537178013    File "/opt/frigate/frigate/object_detection.py", line 52, in __init__
frigate  | 2023-06-05 23:39:17.537184846      self.detect_api = create_detector(detector_config)
frigate  | 2023-06-05 23:39:17.537304456    File "/opt/frigate/frigate/detectors/__init__.py", line 24, in create_detector
frigate  | 2023-06-05 23:39:17.537308049      return api(detector_config)
frigate  | 2023-06-05 23:39:17.537310808    File "/opt/frigate/frigate/detectors/plugins/openvino.py", line 32, in __init__
frigate  | 2023-06-05 23:39:17.537313049      self.interpreter = self.ov_core.compile_model(
frigate  | 2023-06-05 23:39:17.537316141    File "/usr/local/lib/python3.9/dist-packages/openvino/runtime/ie_api.py", line 387, in compile_model
frigate  | 2023-06-05 23:39:17.537318808      super().compile_model(model, device_name, {} if config is None else config),
frigate  | 2023-06-05 23:39:17.537385215  RuntimeError: Failed to allocate graph: MYRIAD device is not opened.

Operating system

raspbian

Install method

Docker Compose

Any other information that may be helpful

No response

NickM-27 commented 1 year ago

I'd suggest reading https://github.com/blakeblackshear/frigate/discussions/3797 where some users tested on the NCS

NateMeyer commented 1 year ago

I don't think Intel's OpenVino library currently supports the v1 NCS. I'm unsure when the last supported library version was. They also have removed support for the MYRIAD plugin and NCS2 stick in 2023.x versions.

NickM-27 commented 1 year ago

Ah my bad, thanks for the correction. Perhaps we should update the docs to specify myriad device is NCS2 only?

github-actions[bot] commented 1 year ago

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.