roflcoopter / viseron

Self-hosted, local only NVR and AI Computer Vision software. With features such as object detection, motion detection, face recognition and more, it gives you the power to keep an eye on your home, office or any other place you want to monitor.
MIT License
1.76k stars 179 forks source link

Codeproject.ai detector exception with v3.0.0b9 #801

Closed fnhieu closed 2 months ago

fnhieu commented 2 months ago

Hi !

I got an exception when motion is triggered and doing a object detection with codeproject.ai module :

[2024-08-23 23:27:26] [ERROR ] [root] - Uncaught thread exception Traceback (most recent call last): File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner self.run() File "/usr/lib/python3.10/threading.py", line 953, in run self._target(*self._args, **self._kwargs) File "/src/viseron/domains/object_detector/__init__.py", line 465, in _object_detection objects = self.return_objects(preprocessed_frame) File "/src/viseron/components/codeprojectai/object_detector.py", line 97, in return_objects return self.postprocess(detections) File "/src/viseron/components/codeprojectai/object_detector.py", line 76, in postprocess DetectedObject.from_absolute_letterboxed( File "/src/viseron/domains/object_detector/detected_object.py", line 127, in from_absolute_letterboxed (rel_x1, rel_y1, rel_x2, rel_y2) = convert_letterboxed_bbox( File "/src/viseron/helpers/__init__.py", line 515, in convert_letterboxed_bbox raise ValueError( **ValueError: Can only convert bbox from a letterboxed image for models of equal width and height, got 640x360** [2024-08-23 23:27:29] [ERROR ] [viseron.components.nvr.nvr.exterieur] - Failed to retrieve result for object_detector

My config.yaml :

# Thanks for trying out Viseron!
# This is a small walkthrough of the configuration to get you started.
# There are far more components and options available than what is listed here.
# See the documentation for the full list of configuration options.

## Start by adding some cameras
ffmpeg:
  camera:
    exterieur:  # This value has to be unique across all cameras
      name: exterieur
      host: 192.168.69.11
      port: 554
      path: /h265Preview_01_main
      username: USER
      password: PASSWORD
      substream:
        port: 554
        path: /h265Preview_01_sub

## You can also use motion detection
mog2:
  motion_detector:
    cameras:
      exterieur:
        fps: 5

codeprojectai:
  host: 192.168.69.12
  port: 32168
  object_detector:
    cameras:
      exterieur:
        fps: 5
        log_all_objects: true
        labels:
          - label: person
            confidence: 0.7
            trigger_recorder: true
          - label: cat
            confidence: 0.5
            trigger_recorder: true
          - label: dog
            confidence: 0.5
            trigger_recorder: true

nvr:
  exterieur:
roflcoopter commented 2 months ago

Thanks for the report! Will look into it later today

roflcoopter commented 2 months ago

Sorry for the delay, should be fixed now in b10!