Commit Graph
144 Commits
Author SHA1 Message Date
Blake Blackshear 6b2bae040c stop forcing detection all the way to stationary_threshold 2022-02-11 07:34:42 -06:00
Blake Blackshear 0b02f20b26 make stationary_threshold configurable 2022-02-08 07:40:45 -06:00
Blake Blackshear 9a0d276761 allow motion based retention when detect is disabled 2022-02-06 14:49:54 -06:00
Blake Blackshear 3600ebca39 adjust error messages on ffmpeg crash 2022-02-06 08:46:41 -06:00
Blake Blackshear 2b7d38f947 avoid extra tracking work on stationary frames 2022-02-05 09:38:22 -06:00
Blake Blackshear 955c2779d9 dont stop scanning when there are other regions 2022-02-05 09:38:22 -06:00
Blake Blackshear 037f8667a6 default periodic checks to never 2022-02-05 09:38:22 -06:00
Blake Blackshear 307068a61f scan the frame on startup 2022-02-05 09:38:22 -06:00
Blake Blackshear 92f9195075 randomize the region multiplier for variation 2022-02-05 09:38:22 -06:00
Yuriy SannikovandYS 9edf38347c safe refactoring (#2552)
Co-authored-by: YS <ys@gm.com>
2021-12-31 11:59:43 -06:00
Blake Blackshear ae968044d6 revert switch to b/w frame prep 2021-11-17 07:28:53 -06:00
Blake Blackshear b912851e49 fix default motion comment 2021-11-15 06:54:03 -06:00
Blake Blackshear 57dcb29f8b consolidate regions 2021-11-08 07:36:21 -06:00
Blake Blackshear 58117e2a3e check for overlapping motion boxes 2021-11-08 07:36:21 -06:00
Blake Blackshear 5bec438f9c config option for stationary detection interval 2021-11-01 07:58:30 -05:00
Blake Blackshear 24cc63d6d3 drop high overlap detections 2021-11-01 07:58:30 -05:00
Blake Blackshear d17bd74c9a reduce detection rate for stationary objects 2021-11-01 07:58:30 -05:00
Blake Blackshear 8f101ccca8 improve box merging and keep tracking 2021-11-01 07:58:30 -05:00
Blake Blackshear b143e11e0e cleanup logging 2021-08-16 07:38:53 -05:00
Blake Blackshear 2181379475 stop using pycoral libs for efficiency 2021-08-15 09:14:13 -05:00
Blake Blackshear 0ccf543ec1 clarify a few things in logs 2021-08-14 14:04:00 -05:00
Blake Blackshear 1823bd0305 fix scaling 2021-08-09 07:46:28 -05:00
Blake Blackshear dc759a3e56 use new pycoral libraries 2021-08-07 15:34:55 -05:00
Blake Blackshear 92aa16c556 add labelmap customization to the config (fixes #507) 2021-07-07 22:58:18 -05:00
Patrick 7ad8b8298d identity check is correct way to check for None 2021-06-27 08:09:58 -05:00
Sean Vig 84a0827aee Use dataclasses for config handling
Use config data classes to eliminate some of the boilerplate associated
with setting up the configuration.  In particular, using dataclasses
removes a lot of the boilerplate around assigning properties to the
object and allows these to be easily immutable by freezing them.  In the
case of simple, non-nested dataclasses, this also provides more
convenient `asdict` helpers.

To set this up, where previously the objects would be parsed from the
config via the `__init__` method, create a `build` classmethod that does
this and calls the dataclass initializer.

Some of the objects are mutated at runtime, in particular some of the
zones are mutated to set the color (this might be able to be refactored
out) and some of the camera functionality can be enabled/disabled.  Some
of the configs with `enabled` properties don't seem to have mqtt hooks
to be able to toggle this, in particular, the clips, snapshots, and
detect can be toggled but rtmp and record configs do not, but all of
these configs are still not frozen in case there is some other
functionality I am missing.

There are a couple other minor fixes here, one that was introduced
by me recently where `max_seconds` was not defined, the other to
properly `get()` the message payload when handling publishing mqtt
messages sent via websocket.
2021-05-23 20:38:57 -05:00
Sean Vig 57864f2be6 Wait on stop event when possible
Generally eliminate the `while True` loops while waiting for a stop
event and prefer to condition the loops on if the stop event is set,
blocking on that where it makes sense.  This generally comes in 3
flavors.  First and simplest, when there is a sleep and the stop event
is the only thing the loop blocks on, instead do a check using
`stop_event.wait(timeout)` to instead block on the stop event for the
designated amount of time. Second, when there is a different event that
is blocking in the loop, condition the loop on `stop_event.is_set()`
rather than breaking when it is set. Finally, when there is a separate
internal condition that requires a counter, have the loop iterate over
the counter and use `if stop_event.wait(timeout)` internal to the loop.
2021-05-22 07:54:16 -05:00
Blake Blackshear 39ff49e054 formatting cleanup 2021-02-25 07:01:57 -06:00
Blake Blackshear e299e73a68 ignore detections that don't overlap with motion 2021-02-20 08:20:17 -06:00
Blake Blackshear 9550ac7422 fix intersection calculation 2021-02-20 08:20:17 -06:00
Blake Blackshear 1cbe6f77ee only run detection on objects that intersect with motion 2021-02-20 08:20:17 -06:00
Blake Blackshear ee3e744cc6 tail last 100 lines of ffmpeg logs and dump when failure detected 2021-01-31 06:18:35 -06:00
Blake Blackshear 39040c1874 enable and disable detection via mqtt 2021-01-26 21:40:33 -06:00
Blake Blackshear b2c7fc8f5b add mask as object filter 2021-01-26 21:40:33 -06:00
Nat Morris 4619836122 Set titles for forked processes 2021-01-26 21:40:33 -06:00
Blake Blackshear 899d41f361 allow runtime drawing settings for mjpeg and latest 2021-01-26 21:40:33 -06:00
Blake Blackshear 3bc7cdaab6 configurable motion and detect settings 2021-01-26 21:40:33 -06:00
Blake Blackshear a4b88ac4a7 fix process clip 2021-01-26 21:40:33 -06:00
Blake Blackshear d0470fffcc allow defining model shape and switch to mobiledet as default model 2021-01-26 21:40:33 -06:00
Blake Blackshear d60ca9d783 log level configuration 2021-01-26 21:40:33 -06:00
Blake Blackshear d62aec7287 graceful exit of subprocesses 2021-01-26 21:40:33 -06:00
Blake Blackshear 4e0cf3681e add multiple streams per camera 2021-01-26 21:40:33 -06:00
Blake Blackshear 03c855ecbe sort imports 2021-01-26 21:40:33 -06:00
Blake Blackshear 3a3cb24631 naming threads and processes for logs 2021-01-26 21:40:33 -06:00
Blake Blackshear 4c3fea25a5 use a queue for logging 2021-01-26 21:40:33 -06:00
Blake Blackshear af303cbf2a create typed config classes 2021-01-26 21:40:33 -06:00
Blake Blackshear 9778a748fc add capture processes 2021-01-26 21:40:33 -06:00
Blake Blackshear a89dddcafa add camera processors 2021-01-26 21:40:33 -06:00
Blake Blackshear 64b63142b1 start the frame rate tracker 2020-10-26 08:01:18 -05:00
Blake Blackshear cee1ab000b make ffmpeg pid available for cache maintenance (fixes #271) 2020-10-26 08:01:18 -05:00