Commit Graph

24 Commits

Author SHA1 Message Date
Josh Hawkins
5593495abd
Fixes (#18893)
* i18n translated label fixes

* Fix frame cache race bug

Objects that were marked as false positives (that would later become true positives) would sometimes have their saved frame prematurely removed from the frame cache.
2025-06-26 09:25:47 -05:00
Josh Hawkins
f97629433d
Fixes (#18877)
* Object labels with spaces should use correct i18n keys

* Add Hungarian

* Ensure onvif move request has a valid speed before removing

When autotracking zooming is set to `disabled` (or is left out of the config), move_request["Speed"] may not exist, depending on the camera

* Add another frame cache debug log
2025-06-25 16:45:24 -05:00
Josh Hawkins
cc368dd20f
Fixes (#18833)
* Don't allow editing of sub label until object lifecycle has ended

* Update sub labels in ended review segments

When manually editing a sub label for a tracked object from the UI, any review segments containing that tracked object did not have their sub_labels and objects values altered

* simplify

* Additional onvif debug logs in get_camera_status

* Ensure that best object is only set when the snapshot is actually updated.

* Don't hide downlaod button when there is no review item

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2025-06-23 17:40:21 -06:00
Nicolas Mowen
8a9ebe9292
Fixes (#18795)
* Catch error when regex is invalid

* Fix i18n label

* Mobile camera drawer i18n fixes

* additional frame cache debug logs

* Add Romanian

* Fix exports thumbnail path

* Improve clip buffer and remove outdated comments

---------

Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com>
2025-06-20 17:39:47 -05:00
Josh Hawkins
d727adddde
Improve frame cache debugging (#18741) 2025-06-16 08:29:54 -06:00
Josh Hawkins
25cc2f31d4
Debug frame cache (#18697) 2025-06-12 13:39:06 -06:00
Josh Hawkins
5d13925d2b
Fixes (#18275) 2025-05-17 16:11:19 -06:00
Nicolas Mowen
d3d05fa397
Fixes (#18220)
* Add option to not trim clip

* Improve API

* Update snapshot for new best objects

* Fix missing strings

* Convert to separate key

* Always include bounding box on snapshots

* improve autotracking relative zooming time calculation

* update proxy docs to note the need for comma separated header roles

* Add count translation

* tracked object lifecycle i18n fix

* update speed estimation docs

* clarity

* Re-initialize onvif information when toggling camera on live view

* Move time ago to card info and add face area

* Clarify face recognition docs

* Increase minimum face recognition area

* use clipFrom to in vod module endpoint to start at the correct time

* Cleanup media api

* Don't change duration

* Use search detail dialog for face library

* Move to segment based

* Cleanup

* Add back duration modification

* clean up docs

---------

Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com>
2025-05-14 16:44:06 -06:00
Martin Weinelt
4d4d54d030
Fix various typing issues (#18187)
* Fix the `Any` typing hint treewide

There has been confusion between the Any type[1] and the any function[2]
in typing hints.

[1] https://docs.python.org/3/library/typing.html#typing.Any
[2] https://docs.python.org/3/library/functions.html#any

* Fix typing for various frame_shape members

Frame shapes are most likely defined by height and width, so a single int
cannot express that.

* Wrap gpu stats functions in Optional[]

These can return `None`, so they need to be `Type | None`, which is what
`Optional` expresses very nicely.

* Fix return type in get_latest_segment_datetime

Returns a datetime object, not an integer.

* Make the return type of FrameManager.write optional

This is necessary since the SharedMemoryFrameManager.write function can
return None.

* Fix total_seconds() return type in get_tz_modifiers

The function returns a float, not an int.

https://docs.python.org/3/library/datetime.html#datetime.timedelta.total_seconds

* Account for floating point results in to_relative_box

Because the function uses division the return types may either be int or
float.

* Resolve ruff deprecation warning

The config has been split into formatter and linter, and the global
options are deprecated.
2025-05-13 08:27:20 -06:00
Josh Hawkins
da62c41e87
Improve object tracking (#17671)
* Save initial frame of new objects to frame cache
Objects that move quickly through the frame and are only seen briefly may not have the update() method called to save thumbnail_data, and may not have the initial frame saved to the tracked object frame cache. This caused a "Frame missing from frame cache" message that was patched by #7313 but this sometimes caused the wrong frame to be chosen for the thumb/snapshot.

* Tracking tweaks
- When registering new objects, use the past detections from Norfair to populate self.positions and self.stationary_box_history. This prevents the first call of update_position() from triggering a +1 on the object's stationary count (because the iou would be 1.0).
- Add a specific tracker for dedicated LPR cam license_plate objects using a lower R value and higher distance threshold to account for fast moving plates.
- Add helpful debug messages and keep them disabled with `if False:`
2025-04-13 12:10:35 -06:00
Nicolas Mowen
3d2bfa34c8
Face fixes (#17618)
* Correctly ensure updates are more periodic when lpr or face detection is needed

* Cleanup

* Update api schema

* Don't update for stationary objects

* Simplify check

* Remove
2025-04-09 20:56:11 -05:00
Josh Hawkins
2920127ada
Dedicated LPR improvements (#17453)
* remove license plate from attributes for dedicated lpr cameras

* ensure we always have a color

* use frigate+ models with dedicated lpr cameras

* docs

* docs clarity

* docs enrichments

* use license_plate as object type
2025-03-30 07:43:24 -06:00
Nicolas Mowen
e3d4b84803
Face recognition improvements (#17387)
* Increase frequency of updates when internal face detection is used

* Adjust number of required faces based on detection type

* Adjust min_score config to unknown_score

* Only for person

* Improve typing

* Update face rec docs

* Cleanup ui colors

* Cleanup
2025-03-26 07:23:01 -06:00
Nicolas Mowen
c239721021
Ensure thumb camera directory exists before saving (#17339) 2025-03-24 09:39:51 -05:00
Josh Hawkins
fa4643fddf
LPR improvements (#17289)
* config options

* processing in maintainer

* detect and process dedicated lpr plates

* create camera type, add manual event and save snapshot

* use const

* ensure lpr events are always detections, typing fixes

* docs

* docs tweaks

* add preprocessing and penalization for low confidence chars
2025-03-23 13:30:48 -06:00
Nicolas Mowen
d4d5c4aac8
Disabled cameras fixing (#17273)
* Fix case where objects are returned as null

* Fix enabled status not being persisted

* Use config as source of truth when refreshed

* Ensure camera always have config object updated

* Cleanup typing
2025-03-20 11:20:44 -05:00
Josh Hawkins
124cc4c9cc
Rename identifier field (#17128)
* backend rename

* frontend

* docs

* fix api path
2025-03-12 17:45:16 -06:00
Josh Hawkins
6360802612
Use identifier field for unknown license plates (#17123)
* backend

* backend fixes

* api for search queries

* frontend

* docs

* add filterable scroll list to more filters pane for identifiers

* always publish identifier
2025-03-12 14:38:28 -06:00
Nicolas Mowen
b3d5cd9e4b
Refactor manual event api to use ZMQ (#17105)
* Don't wait for topic

* Refactor object processing and camera state

* Move manual event handling to camera state / tracked object

* Cleanup

* Refactor audio to use internal zmq

* Cleanup

* Clenaup

* Cleanup

* Quick label fix

* Fix tests

* Cleanup
2025-03-11 22:31:05 -05:00
Josh Hawkins
531042467a
Dynamically enable/disable cameras (#16894)
* config options

* metrics

* stop and restart ffmpeg processes

* dispatcher

* frontend websocket

* buttons for testing

* don't recreate log pipe

* add/remove cam from birdseye when enabling/disabling

* end all objects and send empty camera activity

* enable/disable switch in ui

* disable buttons when camera is disabled

* use enabled_in_config for some frontend checks

* tweaks

* handle settings pane with disabled cameras

* frontend tweaks

* change to debug log

* mqtt docs

* tweak

* ensure all ffmpeg processes are initially started

* clean up

* use zmq

* remove camera metrics

* remove camera metrics

* tweaks

* frontend tweaks
2025-03-03 08:30:52 -07:00
Josh Hawkins
0083d09a8b
Bugfix: ensure all object labels are added to zones (#16686) 2025-02-19 06:25:39 -07:00
Nicolas Mowen
9236898a9d Sub label sensors (#16218)
* Support mqtt sensors for logo attributes

* Expose in api
2025-02-08 12:47:01 -06:00
Nicolas Mowen
1edbd2d498 Refactor camera activity processing (#15803)
* Replace object label sensors with new manager

* Implement zone topics

* remove unused
2025-02-08 12:47:01 -06:00
gtsiam
c0bd3b362c
Custom classes for Process and Metrics (#13950)
* Subclass Process for audio_process

* Introduce custom mp.Process subclass

In preparation to switch the multiprocessing startup method away from
"fork", we cannot rely on os.fork cloning the log state at fork time.
Instead, we have to set up logging before we run the business logic of
each process.

* Make camera_metrics into a class

* Make ptz_metrics into a class

* Fixed PtzMotionEstimator.ptz_metrics type annotation

* Removed pointless variables

* Do not start audio processor when no audio cameras are configured
2024-09-27 07:53:23 -05:00