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

object_detector failure with darknet #740

Open
csuther28 opened this issue May 2, 2024 · 4 comments
Open

object_detector failure with darknet #740

csuther28 opened this issue May 2, 2024 · 4 comments

Comments

@csuther28
Copy link

I get the following failure once viseron started up in docker:

'''
[2024-05-02 17:18:31] [DEBUG ] [viseron.components.nvr.nvr.camera_1] - Initializing NVR for camera Driveway
[2024-05-02 17:18:31] [DEBUG ] [viseron.components.nvr.nvr.camera_1] - Waiting for first frame
[2024-05-02 17:18:31] [DEBUG ] [viseron.components.ffmpeg.camera.camera_1] - Starting capture thread
[2024-05-02 17:18:31] [DEBUG ] [viseron.components.ffmpeg.stream.camera_1] - FFmpeg decoder command: ffmpeg_camera_1 -hide_banner -loglevel error -avoid_negative_ts make_zero -fflags nobuffer -flags low_delay -strict experimental -fflags +genpts -use_wallclock_as_timestamps 1 -vsync 0 -timeout 5000000 -rtsp_transport tcp -i rtsp://:@@192.168.0.103:554/h264Preview_01_main -f segment -segment_time 5 -reset_timestamps 1 -strftime 1 -c:v copy -c:a aac /segments/camera_1/%Y%m%d%H%M%S.mp4 -vf fps=2.0 -f rawvideo -pix_fmt nv12 pipe:1
[2024-05-02 17:18:31] [INFO ] [viseron.components.nvr.nvr.camera_1] - NVR for camera Driveway initialized
[2024-05-02 17:18:31] [INFO ] [viseron.components] - Setup of domain nvr for component nvr with identifier camera_1 took 0.0 seconds
[2024-05-02 17:18:31] [INFO ] [viseron.core] - Viseron initialized in 4.4 seconds
[2024-05-02 17:18:36] [DEBUG ] [viseron.components.nvr.nvr.camera_1] - First frame received
[2024-05-02 17:18:39] [ERROR ] [viseron.components.nvr.nvr.camera_1] - Failed to retrieve result for object_detector
[2024-05-02 17:18:39] [DEBUG ] [viseron.components.nvr.nvr.camera_1] - Frame is 2.531282901763916 seconds old. Discarding
[2024-05-02 17:18:39] [DEBUG ] [viseron.components.nvr.nvr.camera_1] - Frame is 2.0378434658050537 seconds old. Discarding
[2024-05-02 17:18:39] [DEBUG ] [viseron.components.nvr.nvr.camera_1] - Frame is 1.4673566818237305 seconds old. Discarding
[2024-05-02 17:18:39] [DEBUG ] [viseron.components.nvr.nvr.camera_1] - Frame is 1.0376908779144287 seconds old. Discarding
[2024-05-02 17:18:42] [ERROR ] [viseron.components.nvr.nvr.camera_1] - Failed to retrieve result for object_detector
[2024-05-02 17:18:42] [DEBUG ] [viseron.components.nvr.nvr.camera_1] - Frame is 3.105250120162964 seconds old. Discarding
[2024-05-02 17:18:42] [DEBUG ] [viseron.components.nvr.nvr.camera_1] - Frame is 2.5575098991394043 seconds old. Discarding
'''

The following is my config:
'''
ffmpeg:
camera:
camera_1: # This value has to be unique across all cameras
name: Driveway
host: 192.168.0.103
port: 554
path: /h264Preview_01_main
protocol: rtsp
width: 2560
height: 1920
fps: 15
audio_codec: aac
username: !secret ovif_user
password: !secret ovif_pwd
recorder:
filename_pattern: '%H%M%S'

darknet:
object_detector:
cameras:
camera_1: # Attach detector to the configured camera_1 above
fps: 2
scan_on_motion_only: false # false = Scan for objects even when there is no motion
log_all_objects: false
labels:
- label: person
confidence: 0.75
trigger_recorder: true
- label: vehicle
confidence: 0.75
trigger_recorder: true
- label: dog
confidence: 0.75
trigger_recorder: true
- label: cat
confidence: 0.75
trigger_recorder: true
mog2:
motion_detector:
cameras:
camera_1: # Attach detector to the configured camera_2 above
trigger_recorder: true
recorder_keepalive: true
fps: 2
nvr:
camera_1: # Run NVR for camera_1
'''

Any idea what I'm doing wrong?

The motion recording is working great though.

@csuther28
Copy link
Author

The following observation via logs the next day for above camera:

'''
[2024-05-03 10:25:48] [DEBUG ] [viseron.components.nvr.nvr.camera_1] - Frame is 1.148996114730835 seconds old. Discarding
[2024-05-03 10:25:48] [DEBUG ] [viseron.components.mog2.motion_detector.camera_1] - Max motion area: 0.00218
[2024-05-03 10:25:51] [ERROR ] [viseron.components.nvr.nvr.camera_1] - Failed to retrieve result for object_detector
[2024-05-03 10:25:51] [DEBUG ] [viseron.components.nvr.nvr.camera_1] - Frame is 3.203981876373291 seconds old. Discarding
[2024-05-03 10:25:51] [DEBUG ] [viseron.components.nvr.nvr.camera_1] - Frame is 2.7307252883911133 seconds old. Discarding
[2024-05-03 10:25:51] [DEBUG ] [viseron.components.nvr.nvr.camera_1] - Frame is 2.2098772525787354 seconds old. Discarding
[2024-05-03 10:25:51] [DEBUG ] [viseron.components.nvr.nvr.camera_1] - Frame is 1.57594895362854 seconds old. Discarding
[2024-05-03 10:25:51] [DEBUG ] [viseron.components.nvr.nvr.camera_1] - Frame is 1.201096534729004 seconds old. Discarding
[2024-05-03 10:25:51] [DEBUG ] [viseron.components.mog2.motion_detector.camera_1] - Max motion area: 0.00161
[2024-05-03 10:25:54] [DEBUG ] [viseron.components.darknet.object_detector.camera_1] - Objects: [{'label': 'person', 'confidence': 0.869, 'rel_width': 0.092, 'rel_height': 0.334, 'rel_x1': 0.375, 'rel_y1': 0.061, 'rel_x2': 0.467, 'rel_y2': 0.395}]
[2024-05-03 10:25:54] [DEBUG ] [viseron.components.darknet.object_detector.camera_1] - Frame is 3.518185615539551 seconds old. Discarding
[2024-05-03 10:25:54] [DEBUG ] [viseron.components.nvr.nvr.camera_1] - Frame is 3.085675001144409 seconds old. Discarding
[2024-05-03 10:25:54] [DEBUG ] [viseron.components.nvr.nvr.camera_1] - Frame is 2.3212411403656006 seconds old. Discarding
'''

From this I gather that the OBJECT DETECTOR is working and detected a person within the area.
But still with the issue 'Failed to retrieve result for object_detector'

@roflcoopter
Copy link
Owner

Hmm strange, seems that inference is too slow.
Is your CPU maxed out while Viseron is running?

@csuther28
Copy link
Author

When I started off, all seems ok...except for the mentioned error alert....at some time did I detect a slowness on server, on closer look, the CPUs were maxed out...I then disabled the object_detector to run continues without motion detector...after this did CPU normalize.......but this alert still popping up.

@roflcoopter
Copy link
Owner

Does it get any better if you set fps: 1 for the object_detector?

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

No branches or pull requests

2 participants