@roflcoopter
Yes, I read about triggers recording
.
Does it store images only?
Or in this case I need to capture picture with own code (image_processing
)?
It will not store any images no, however you will get notifications over MQTT that you can act upon
@roflcoopter
Is there any model set that would be more optimal for recognition of cars/people for cameras installed on high levels (6.5 meters in my case)? Camera view is different from a âdoorbell-likeâ viewpoint, thus only quite a few objects can be recognized.
Not that i am aware of sadly, you could train your own YOLOv4 model, but this is beyond my knowledge unfortunately
I managed to get it working almost normally. But I have one issue:
People are not being detected unless a big objject is detected (car, truck), then Person is also detected in same area. What is wrong with that? I tried to make motion detection config as much sensitive as possible. Person-only not working properly unless motion is triggered by a bigger-sized object:
cameras:
- name: RoadLeft
host: 192.168.0.4
port: 554
username: root
password: pass
path: /axis-media/media.amp?streamprofile=viseron
publish_image: true
fps: 10
motion_detection:
mask:
- points:
- x: 0
y: 626
- x: 0
y: 0
- x: 1920
y: 0
- x: 1920
y: 609
- x: 1721
y: 339
- x: 1524
y: 222
- x: 1195
y: 189
- x: 754
y: 194
- x: 406
y: 244
- x: 208
y: 297
object_detection:
interval: 0.25
labels:
- label: person
confidence: 0.4
- label: car
confidence: 0.6
- label: truck
confidence: 0.6
motion_detection:
interval: 0.25
area: 0.02
threshold: 6
trigger_detector: true
timeout: true
max_timeout: 3
recorder:
lookback: 2
timeout: 3
retain: 7
# MQTT is optional
mqtt:
broker: 192.168.0.3
port: 1883
username: Max
password: pass
So what youâre saying is motion detection does not pick up people?
If you watch the camera entity in Home Assistant, it will draw contours on the image displaying detected motion. It is color coded to let you know if your threshold is too low. You can read more here.
Does that give you any hints?
It draws contours for Persons (blue ones), but no red boxes with caption âPersonâ.
For you reference, when I manually zoom in-out camera (intentionally to make all pixels âtriggerâ) then Person becomes detected (Object detection starts working).
Same effect if a car passes by, it triggers motion more than a person, and in this case person standing next to cars becomes recognised by Object detection.
In case I lower down Threshold to very small number, I get everything triggered continously and object detector does not stop working (even if motion stops entirely), neverending recording begins. It starts discovering unnecessary objects like âchairâ, for instance, and âcarâ which is in Masked zone. So itâs impossible to make your SW discover only selected objects (person, car) only in unMasked areaâŚ
@roflcoopter
I understood why objects are still getting detected despite being in Masked area. Cars are coming with lights and invoking motion, thus it triggers almost everytime.
Can you add an option so that motion recording would occur ONLY if objects are detected in area beyod mask? This would be much more reasonable for different alarm scenarios (especially at night, when headlights trigger unwanted motion in unMasked areas). I think this is not hard to realize.
Thanks in advance for your product!!!
Im not sure if im understanding you correctly, but the mask is only used for limiting where motion detection is triggered. To limit object detection to a specific area you can use zones. Is that what youâre after?
@roflcoopter
Yes I understand you. My point is:
I have my general âobject-detectionâ settings. Maybe I need to point âobject_detectionâ parameters under camera, then everything except zones appointed for camera wonât be detected & recorded?
Looks like Viseron records all even beyond set zones because object detection settings are pointed for all cameras but not secifically for the one that I limit to zonesâŚ
Ah yes that is correct. If you create a separate object_detection
block for your camera, it will override the global object_detection
block
Still, the problem of never-ending recording persists:
I have one Zone appointed. When a car or person passes by my zone boundary and detection rectangle overlaps the Zone slightly, recording starts and keeps on running unless I restart Viseron (recording starts when object is detected beyond the ZoneâŚ). This behavior remains unclear especially when I got explicit recorder settings set that limit recording time (until next one is fired).
My current settings:
cameras:
- name: FrontYard
host: 192.168.0.4
port: 554
username: root
password: pass
path: /axis-media/media.amp?streamprofile=viseron
publish_image: true
fps: 10
motion_detection:
area: 0.02
interval: 0.25
threshold: 3
trigger_detector: true
timeout: true
max_timeout: 5
zones:
- name: zone1
points:
- x: 1709
y: 353
- x: 1810
y: 443
- x: 1920
y: 609
- x: 1920
y: 1075
- x: 0
y: 1077
- x: 0
y: 665
- x: 175
y: 370
- x: 243
y: 341
- x: 292
y: 294
- x: 637
y: 221
- x: 978
y: 195
- x: 1315
y: 209
- x: 1512
y: 239
labels:
- label: person
confidence: 0.4
object_detection:
interval: 0.25
labels:
- label: person
confidence: 0.4
recorder:
lookback: 2
timeout: 3
retain: 3
# MQTT is optional
mqtt:
broker: 192.168.0.3
port: 1883
username: Max
password: pass
Hmm that should not happen since you have max_timeout set. Could you turn on debug logging and show me?
OK! I will turn on debugging & share it with you.
According to my observations recorder starts every time when blue curves (motion detection that outlines moving objects near my zone) overlap my zone, the motion starts and the recording starts all over.
Recording (JPG & MP4 writing to disk) should start ONLY when an object is detected within my Zone, right?
Will come back to you soon.
Please have a look at this:
The log is too big to be inserted within the text of my message.
Just for your reference, recordings at 19:40, 19:52, and after that time have nothing in common with objects location within my detection Zone. All objects were detected beyond zone area.
I dont see any never ending recordings in that log, however there is something wrong with the creation of recordings using segments. I am thinking they may be deleted too soon. Do you have a timezone mismatch between the host and the container? Could you show me your docker run command?
If you want to only record when something is in a zone you need to use this config:
cameras:
- name: FrontYard
host: 192.168.0.4
port: 554
username: root
password: pass
path: /axis-media/media.amp?streamprofile=viseron
publish_image: true
fps: 10
motion_detection:
area: 0.02
interval: 0.25
threshold: 3
trigger_detector: true
timeout: true
max_timeout: 5
zones:
- name: zone1
points:
- x: 1709
y: 353
- x: 1810
y: 443
- x: 1920
y: 609
- x: 1920
y: 1075
- x: 0
y: 1077
- x: 0
y: 665
- x: 175
y: 370
- x: 243
y: 341
- x: 292
y: 294
- x: 637
y: 221
- x: 978
y: 195
- x: 1315
y: 209
- x: 1512
y: 239
labels:
- label: person
confidence: 0.4
object_detection:
interval: 0.25
labels: []
object_detection:
interval: 0.25
labels: []
recorder:
lookback: 2
timeout: 3
retain: 3
# MQTT is optional
mqtt:
broker: 192.168.0.3
port: 1883
username: Max
password: pass
OK, thanks! Iâll try your suggested config. The only difference compared to mine, as I noticed, is pointing object_detection
in a general section not only specifically for the camera.
Yes, in that log there were no neverending recordings, as I started the container anew. If there will be any, I will necessarily post the log.
I checked date
command in my host machine and Viseron container, time matches, no issues.
My Docker Run command is:
docker run -d --restart unless-stopped \
-v /usr/share/hassio/media/viseron:/recordings \
-v /usr/share/hassio/homeassistant/viseron:/config \
-v /etc/localtime:/etc/localtime:ro \
--name viseron \
--runtime=nvidia \
roflcoopter/viseron-cuda:latest
Yes that is the only difference.
The default value for object_detection
is to scan for person and record, so you have to explicitly disable this for the camera. A bit confusing i knowâŚ
Regarding the segments not working, when Viseron is running, can you run this and show me the output?
docker exec -it viseron ls -al /segments/FrontYard
Yes, here it is:
root@max-HP-Z240-SFF-Workstation:~# docker exec -it viseron ls -al /segments/FrontYard
total 9424
drwxr-xr-x 2 root root 4096 Mar 29 11:52 .
drwxrwxrwx 1 root root 4096 Mar 28 18:23 ..
-rw-r--r-- 1 root root 1539740 Mar 29 11:47 20210329114528.mp4
-rw-r--r-- 1 root root 2088091 Mar 29 11:48 20210329114711.mp4
-rw-r--r-- 1 root root 2472987 Mar 29 11:50 20210329114853.mp4
-rw-r--r-- 1 root root 1695943 Mar 29 11:52 20210329115035.mp4
-rw-r--r-- 1 root root 1835056 Mar 29 11:52 20210329115218.mp4