#Getting car detection when parking or leaving, but not all the time the car is in the driveway

93 messages · Page 1 of 1 (latest)

marble cargo
#

Since we now have a car I have enabled car detection in my config, but everything's going a bit crazy and getting constant detections and alerts all day long.

Hopefully you can help me with adjusting the config.

I would like car and person as alert in both zones, and cat as detection in both too. But for the car, only alert when it was parked or leaves (not the entirety of the time it's there).

Attached an example of a detection outside of the relevant zones. This is in the new Explore mode (not sure if a tracked object here constitutes a detection in Review, since it's hard for me to find what was "detected" in Review due to lack of bounding boxes).

Current settings:

  doorbell:
    # enabled: false
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/doorbell
          roles:
            - record
            - detect
            - audio
    live:
      stream_name: doorbell
    detect:
      width: 1280
      height: 960
      fps: 5
    #birdseye:
    #  order: 1
    zones:
      Front_garden:
        coordinates: 
          0.143,0.527,0.143,0.561,0.373,0.563,0.613,0.56,0.609,0.523,0.716,0.539,0.711,0.646,0.993,0.751,0.995,0.999,0.002,0.999,0,0.557
        inertia: 3
        loitering_time: 0
      Driveway/Neighbours:
        coordinates: 
          0.708,0.515,0.733,0.451,0.91,0.421,1,0.499,1,0.585,0.973,0.754,0.709,0.652,0.712,0.566,0.712,0.541
        inertia: 3
        loitering_time: 5 #seconds
        objects: person
        filters:
          person:
            min_area: 500
    review:
      detections:
        required_zones:
          - Front_garden
          - Driveway/Neighbours
      alerts:
        required_zones: Driveway/Neighbours
    motion:
      mask: 
        0,0.429,0.122,0.421,0.198,0.33,0.56,0.331,0.589,0.434,0.871,0.412,0.896,0.389,0.975,0.436,0.999,0.436,0.999,0.003,0.002,0

Thanks!

bitter crag
#

The bottom center of the red car's bounding box appears to be inside of the zone to me. If you want to detect cars in the driveway, there is no reason to have the zone that high up. Unless of course you have a flying car.

marble cargo
#

Yeahh, you're right. It might be just barely inside.

An alternative to ignore the cars in the background street might be a min_area I guess.

marble cargo
bitter crag
#

probably something like this

marble cargo
#

Will do like this just in case I park further back.

bitter crag
#

looks good to me. that might include some cars driving by on the street if they are close to the driveway.

#

if so, you can just pull it back a little

marble cargo
#

would changing just this achieve my desired outcome?

I would like car and person as alert in both zones, and cat as detection in both too. But for the car, only alert when it was parked or leaves (not the entirety of the time it's there). 
bitter crag
#

it should work that way. reviews are only created when tracked objects are moving

#

so the car will be tracked the entire time

#

you will get alerts when the car moves

#

so coming and going would be separate alerts on the reviews tab

marble cargo
#

oh ok. I need to review another camera then, because it seems to be re-detecting the same cars during the day. I have permanent alerts :S They are the ones further away

bitter crag
#

that would happen if the bounding boxes are unstable which can cause it to appear "moving" to frigate

#

OR it can happen if it is lost and redetected

marble cargo
#

must be something like that

#

seeing here, there are not SO many cars, but constant alert for hours

#

but I'll investigate that more, no worries

bitter crag
#

lots of them are only partially visible, so that often makes it difficult to have accurate bounding boxes

marble cargo
#

yeah, no prob. I will add min_area and other filters to avoid so much alert

bitter crag
#

but if you require the driveway zone for alerts, you shouldnt get these on the street

#

they will end up in detections instead

marble cargo
#

oh, so create another driveway zone in this other camera, and enforce alerts for it.

bitter crag
#

and if there are too many of those, then it just means that the tracking probably isnt reliable enough to make sense of what cars are and arent detected on the street

#

ideally you would only have all the things you really care about in alerts

#

all the noise ends up in detections

marble cargo
#

yeah that's the goal

marble cargo
# bitter crag all the noise ends up in detections
    zones:
      Front_garden:
        coordinates: 
          0.143,0.527,0.143,0.561,0.373,0.563,0.608,0.556,0.609,0.516,0.63,0.515,0.631,0.618,0.993,0.751,0.995,0.999,0.002,0.999,0,0.557
        inertia: 3
        loitering_time: 0
      Drivewayfront:
        coordinates: 0.773,0.579,0.838,0.596,1,0.636,1,0.757,0.621,0.61,0.63,0.597,0.734,0.578
        inertia: 3
        loitering_time: 5
        objects:
          - person
          - car
    review:
      detections:
        required_zones:
          - Front_garden
          - Drivewayfront
      alerts:
        labels: 
          - person
          - car

Can you clarify something please?

With this config for a particular camera.

  • I think I understand the review settings. So there will be no detection of any object if not inside those 2 zones.
  • And only persons and cars will be alerts. Cats will be then classed as detection for example.

What does then the objects key does inside the driveway zone? Will it override and make it ignore cats completely?

I find it hard following the logic with all the rules kinda overlapping each other.

uneven tide
#

Yes, the objects sets what objects can be in that zone

#

The main reason you would use that is if for example you had a zone for cars parking on the street but you didn't want the zone to go off if a person was walking in it

marble cargo
#

cool, so just to exclude certain objects by including the ones I want

marble cargo
#

the new explore tab shows ANY tracked object, is that right? Not just the ones on detection/alert

uneven tide
#

right

#

well

#

the tracked object has to have a snapshot or a clip

marble cargo
#

well I have motion recording. So I guess it comes from there?

uneven tide
#

No, to have a clip it must be either an alert or detectoin

marble cargo
#

ah

#

then the answer is no. Explore will only show for detected/alerts

#

though I'm seeing some objects there that are confusing me, since they're out of any of my detection/alert zones. Hence the question.

#

for example. Car detected, not in any zone.

Based on the earlier config:

    review:
      detections:
        required_zones:
          - Front_garden
          - Drivewayfront
      alerts:
        labels: 
          - person
          - car

And it's NOT showing in detections or alerts.

#

zones again here:

uneven tide
#

okay so there are a few things to clarify here

#

you have car for alert without any required zones for alerts

#

so, every single car that is detected will be an alert

#

also, you need to show your snapshot config

#

because if a snapshot is saved for the car then it would still show up in explore

marble cargo
#

got it. Makes sense.

This is pretty basic.

snapshots:
  enabled: true
  retain:
    default: 10 #days
#

and this... should be like this?

    review:
      detections:
        required_zones:
          - Front_garden
          - Drivewayfront
      alerts:
        labels: 
          - person
          - car
        required_zones:
          - Front_garden
          - Drivewayfront
#

so only the cars and person in the zones launch alerts

#

although that red van is not showing in my alerts (yet it showed up in Explore)

Van was 14:02. Last alert is 13:55

#

the explore tab really picks up something else. It's adding stuff every few seconds for cars. :S And there are no alerts or detections showing up at all in the last 15min.

This is just the last 10mins in Explore for that camera.

uneven tide
#

so it includes everything from 13:55 until now

#

seems like a crash might have happened or you are getting a lot of activity

#

but that perfectly explains what you are seeing

uneven tide
marble cargo
#

ah well, only for those objects not defined in alerts I guess. So in my case just cats.

marble cargo
uneven tide
#

you can check the logs to make sure there was no crash

marble cargo
#

nono there isn't, cause it keeps generating explore objects

marble cargo
uneven tide
uneven tide
#

that is kind of the point of the feature

#

but if you don't want that then you can just change the detections labels

marble cargo
#

ok, I will remove it and see how I feel

#

just realised the ongoing alert was from a diff camera where I didn't have the required_zones. Added now and will monitor again.

marble cargo
#

Is there anything I can do to avoid all these false positives of my car during the night? I guess it's detecting changes in light and assumes it's moving, triggering alerts. Happens with other cars, same camera.
The image seems pretty constant, but something makes it repeat the trigger over and over, but the car did not move at all.

marble cargo
#

@uneven tide Not urgent at all. Just if you're able to provide some insight on this when you can. Thanks.

uneven tide
#

This is easier to debug in 0.15, difficult to know for sure why these are happening. Odds are the car is just getting lost so basic options would be to adjust required zones, tune motion detection, adjust min score to throw out bogus bounding boxes, or improve the model

marble cargo
uneven tide
#

Okay so that means the box was not accurate

#

are you using Frigate+?

marble cargo
#

it's connected, but I never got around to actively use it

uneven tide
#

gotcha, in general this is the type of thing that often is improved with frigate+ as it learns your specific scenario and detections objects more accurately and consistently. Barring that, you can try setting a min_area on the zone, but in general this is a difficult scenario and I imagine the gate there is making things confused

marble cargo
#

got it. I just don't understand enough to use it or how does it improve. I can submit detections but that won't do anything for me, right?

AFAIK it's when I pay to download a custom model that I actually benefit from it?

#

still, the issue is that it's detect/not-detect/detect the car over and over?

#

so maybe lowering the threshold should allow Frigate to understand it's not a new or moving car, but the same one? Is my thinking correct?

uneven tide
#

AFAIK it's when I pay to download a custom model that I actually benefit from it?

right

so maybe lowering the threshold should allow Frigate to understand it's not a new or moving car, but the same one? Is my thinking correct?

no, threshold only dictates if an object is a true positive or not, it does not dictate how frigate tracks the object. The problem here is most likely going to be low scoring boxes that are larger than the actual car, causing frigate to think it is in the zone.

another option you could do is increase the inertia for the zone requiring more frames before the car is considered in the zone

bitter crag
#

you could also refine your zone. it would be nearly impossible for the car in your actual driveway to have its bottom center that high.

#

i would expect that cars on the other side of that fence will enter the zone all the time

marble cargo
# uneven tide > AFAIK it's when I pay to download a custom model that I actually benefit from ...

Ok, thanks both.

I've reduced the zone to try and make sure the cars behind the fence do not get into it. I've noticed that even the white car behind it's being tracked inside the zone sometimes, so I reduced as much as I think it's feasible. Added 1s loitering_time too, which after reading feels more what you meant with inertia.

Will monitor like this tonight and see if it improves.

As a 0.15 feedback, I think it would be immensely useful if the explore objects had a lifecycle event telling us "This triggered a detection/alert". Just like it does saying "Entered zone". Otherwise it's a bit difficult to tell whether that tracked object snippet belongs to any of the detections or alerts we have, or it's just some other tracked stuff we don't necessarily care about.

uneven tide
#

That completely changes the behavior of the zone

marble cargo
marble cargo
#

It's improved A LOT now @uneven tide. Thank you.

I only got the perfect alerts tonight, just when the floodlight turns on, which obv retriggers alert on the car. None of the other 2 cars behind the fence now. Lovely.

Detections (outside the zone) running pretty good as well. Although I'm getting pics of the 250 cars passing through the street every day now 😂 . Not sure I want that. Will leave it for now, and might add an inertia requirement there as well to ignore passing cars in the future.

uneven tide
#

Not sure I want that. Will leave it for now, and might add an inertia requirement there as well to ignore passing cars in the future.

yeah I disabled car detections