Zone Exit Inertia and Entrance Inertia #10745
Replies: 10 comments
-
I can understand waiting a few frames before saying an object is not inside of the zone while it is detected. However, I definitely do not agree with the case where a zone would show as occupied even if the object stops being detected. That is a problem that should be solved on the automation side, not something that frigate should lie about what it is detected to fit this specific use case. |
Beta Was this translation helpful? Give feedback.
-
@NickM-27 In case it is of use to you or others, here is my current automation in Home Assistant:
I understand that intentionally misreporting occupancy could be considered a lie, but a new configuration item would have to be explicitly defined by the user. In my opinion, adding a tool to address the common problem of a frequently obstructed object would make Frigate more versatile, not less accurate. |
Beta Was this translation helpful? Give feedback.
-
if all you care about is zone occupancy then I would not recommend using the /events topic. I'd recommend using the zone sensor that is created. Just because a car is stopped being detected then redetected does not mean the parking space is open. The concern with frigate misreporting info even if a user configured it is it makes it really difficult to debug. A user could set that and forget or even not include it in their config and it would be really difficult to know that is what caused the issue. The data reported by frigate should always match what it actually sees and detects. Forcing zones to not match is a bandaid not a true fix for the actual issue |
Beta Was this translation helpful? Give feedback.
-
I can report that the sensor provided in Home Assistant has the same behavior unfortunately. The accompanying car count sensor also moves to zero for a second or two. Additionally, if the sensor were used, the notification would not have the event ID required to link a snapshot. Is this something I have set up incorrectly? Here is the debug screen. The thicker zone line indicates it is marked occupied presently, but for a second or two it can disappear and I get an event for a car leaving that zone on all channels |
Beta Was this translation helpful? Give feedback.
-
Yes but with the sensor you can use the |
Beta Was this translation helpful? Give feedback.
-
Apologies I amended my previous comment. Using the sensor would lack the event id required for the notification snapshot. This snapshot isn't strictly speaking necessary, but would be nice to have. The Frigate docs point users to use the mqtt event trigger as the recommended approach to notifications https://docs.frigate.video/guides/ha_notifications See paragraph 2 |
Beta Was this translation helpful? Give feedback.
-
That's for general notifications. This is a different use case so that doesn't apply. If you want an image you could use latest.jpg instead of an event specific image |
Beta Was this translation helpful? Give feedback.
-
This is a general notification. See paragraph 3 of the conditions section for the Home Assistant notifications page, I am open to trying other options, I have even attempted using additional training credits to refine the model for cars in hopes of reducing these false negatives. Average confidence went up, but the object was still lost for seconds at a time when partially obstructed. This shows up on the event chain and meets the conditions described: Docs reference:
My automation:
|
Beta Was this translation helpful? Give feedback.
-
By general notifications I mean object being detected in a zone like when you want to know if someone enters a front yard. This is specifically about wanting to know if an object is not in a given area. There are better ways to solve this than using / events. In general, this is something that we've already improved in 0.14 and have other ideas to improve further. With so many cars in the view there are obstructions, ID swaps, and detection itself to be concerned with. Using the event id is just going to make things really difficult. |
Beta Was this translation helpful? Give feedback.
-
@NickM-27 Thank you for converting to a conversation, I'm pretty new to Github. I appreciate all the detailed assistance and I look forward to what 0.14 brings. I will respond back here if I get the automation working reliably |
Beta Was this translation helpful? Give feedback.
-
Describe what you are trying to accomplish and why in non technical terms
I want to be able to set the amount of time an object must be absent from a zone for that zone to be considered unoccupied
Describe the solution you'd like
I would like to have a configuration item for zones, let's say "exit_inertia", which can be set to an integer. This configuration item would determine the number of frames which must pass before an object is assumed to have left the zone.
Describe alternatives you've considered
I have attempted expanding the zone to accommodate the slight motion in an objects bounding box. This works better, but does not account for scenarios where an object is temporarily obstructed and the zone immediately becomes unoccupied. max_disappeared setting does not seem to have this functionality either
Additional context
I live in New Jersey near NYC, and parking out here is TERRIBLE. I have been using Frigate in conjunction with Home Assistant to notify me when the parking space in front of my house is clear. Occasionally, someone will walk in front of one of the cars or park too close, causing the vision model to briefly lose confidence and the object to disappear. I need a way to maintain zone occupancy even if a zone appears unoccupied for a defined amount of time. Presently I get a lot of notifications even though the actual object has not left the zone.
Beta Was this translation helpful? Give feedback.
All reactions