Commit Graph

4437 Commits

Author SHA1 Message Date
Nicolas Mowen
6db70dc101 Implement start for review item description processor (#19352)
* Add review item data transmission

* Publish review updates

* Add review item subscriber

* Basic implementation for testing review processor

* Formatting
2025-08-07 20:58:34 -06:00
Nicolas Mowen
cd97a8618c Improve the tablet layout (#19320)
* Improve the tablet layout

* Update imports sort

* Fix more imports
2025-08-07 20:58:34 -06:00
Steve Smith
44232d31d8 Add bookworm-backports to the rocm images and upgrade mesa/vaapi to support RDNA4 GPUs (#19312) 2025-08-07 20:58:34 -06:00
Nicolas Mowen
b098a5442e Require setting process priority for FrigateProcess (#19207) 2025-08-07 20:58:34 -06:00
Nicolas Mowen
71e18ae888 Object attribute classification (#19205)
* Add enum for type of classification for objects

* Update recognized license plate topic to be used as attribute updater

* Update attribute for attribute type object classification

* Cleanup
2025-08-07 20:58:34 -06:00
Nicolas Mowen
d5553edd9f Classification train updates (#19173)
* Improve model train button

* Add filters for classification

* Cleanup

* Don't run classification on false positives

* Cleanup filter

* Fix icon color
2025-08-07 20:58:34 -06:00
Josh Hawkins
a8404d6ee1 Dynamically enable/disable GenAI (#19139)
* config

* dispatcher and mqtt

* docs

* use config updater

* add switch to frontend
2025-08-07 20:58:33 -06:00
Josh Hawkins
32f547ab59 Optionally show tracked object paths in debug view (#19025) 2025-08-07 20:57:36 -06:00
Josh Hawkins
ef406ba647 Semantic Search Triggers (#18969)
* semantic trigger test

* database and model

* config

* embeddings maintainer and trigger post-processor

* api to create, edit, delete triggers

* frontend and i18n keys

* use thumbnail and description for trigger types

* image picker tweaks

* initial sync

* thumbnail file management

* clean up logs and use saved thumbnail on frontend

* publish mqtt messages

* webpush changes to enable trigger notifications

* add enabled switch

* add triggers from explore

* renaming and deletion fixes

* fix typing

* UI updates and add last triggering event time and link

* log exception instead of return in endpoint

* highlight entry in UI when triggered

* save and delete thumbnails directly

* remove alert action for now and add descriptions

* tweaks

* clean up

* fix types

* docs

* docs tweaks

* docs

* reuse enum
2025-08-07 20:57:35 -06:00
Nicolas Mowen
397777e176 Classification improvements (#19020)
* Move classification training to full process

* Sort class images
2025-08-07 20:56:54 -06:00
Nicolas Mowen
ece5ac6d77 Improve classification UI (#18910)
* Move threhsold to base model config

* Improve score handling

* Add back button
2025-08-07 20:56:54 -06:00
Nicolas Mowen
09c6c3129e Remove TFLite init logs 2025-08-07 20:56:54 -06:00
Nicolas Mowen
7cfef18f4c Improve object classification (#18908)
* Ui improvements

* Improve image cropping and model saving

* Improve naming

* Add logs for training

* Improve model labeling

* Don't set sub label for none object classification

* Cleanup
2025-08-07 20:56:54 -06:00
Nicolas Mowen
c354b4d110 0.17 tweaks (#18892)
* Set version

* Cleanup more logs

* Don't log matplotlib
2025-08-07 20:56:54 -06:00
Josh Hawkins
1af0f530ff Add ONVIF focus support (#18883)
* backend

* frontend and i18n
2025-08-07 20:56:54 -06:00
Nicolas Mowen
bdbbfada53 Improve logging (#18867)
* Ignore numpy get limits warning

* Add function wrapper to redirect stdout and stderr to logpipe

* Save stderr too

* Add more to catch

* run logpipe

* Use other logging redirect class

* Use other logging redirect class

* add decorator for redirecting c/c++ level output to logger

* fix typing

---------

Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com>
2025-08-07 20:56:54 -06:00
Josh Hawkins
61407b90ee Don't try to close or join mp manager queues (#18866)
Multiprocessing Manager queues don't have a close() or join_thread() method, and the Manager will clean it up appropriately after we empty it. This prevents an infinite loop when an AttributeError exception fires for Manager AutoProxy queue objects.
2025-08-07 20:56:54 -06:00
Nicolas Mowen
ae12b430db Handle SIGINT with forkserver (#18860)
* Pass stopevent from main start

* Share stop event across processes

* preload modules

* remove explicit os._exit call

---------

Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com>
2025-08-07 20:56:52 -06:00
Nicolas Mowen
680a141e23 Fix process name 2025-08-07 20:56:08 -06:00
Nicolas Mowen
da2d52645f Classification model cover images (#18843)
* Move to separate component

* Add cover images for clssification models
2025-08-07 20:56:08 -06:00
Josh Hawkins
b17f0c4a30 Catch invalid character index in lpr CTC decoder (#18825) 2025-08-07 20:56:08 -06:00
Josh Hawkins
52e5429b33 Fix birdseye crash when dynamically adding a camera (#18821) 2025-08-07 20:56:08 -06:00
Nicolas Mowen
54bee5ed85 Catch unpickling error 2025-08-07 20:56:08 -06:00
Nicolas Mowen
b142a69c89 Don't fail on unicode debug for config updates 2025-08-07 20:56:08 -06:00
Nicolas Mowen
f6db714016 Don't use staticmethod 2025-08-07 20:56:08 -06:00
Nicolas Mowen
d4ebf467fb Reduce tf initialization 2025-08-07 20:56:08 -06:00
Nicolas Mowen
e4738a2330 Fix go2rtc init (#18708)
* Cleanup process handling

* Adjust process name
2025-08-07 20:56:08 -06:00
Josh Hawkins
3dd7473222 Ensure logging config is propagated to forked processes (#18704)
* Move log level initialization to log

* Use logger config

* Formatting

* Fix config order

* Set process names

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2025-08-07 20:56:08 -06:00
Josh Hawkins
3065f46856 Add basic camera settings to UI for testing (#18690)
* add basic camera add/edit pane to the UI for testing

* only init model runner if transcription is enabled globally

* fix role checkboxes
2025-08-07 20:56:04 -06:00
Nicolas Mowen
930a3e5bc9 Use Fork-Server As Spawn Method (#18682)
* Set runtime

* Use count correctly

* Don't assume camera sizes

* Use separate zmq proxy for object detection

* Correct order

* Use forkserver

* Only store PID instead of entire process reference

* Cleanup

* Catch correct errors

* Fix typing

* Remove before_run from process util

The before_run never actually ran because:

You're right to suspect an issue with before_run not being called and a potential deadlock. The way you've implemented the run_wrapper using __getattribute__ for the run method of BaseProcess is a common pitfall in Python's multiprocessing, especially when combined with how multiprocessing.Process works internally.

Here's a breakdown of why before_run isn't being called and why you might be experiencing a deadlock:

The Problem: __getattribute__ and Process Serialization
When you create a multiprocessing.Process object and call start(), the multiprocessing module needs to serialize the process object (or at least enough of it to re-create the process in the new interpreter). It then pickles this serialized object and sends it to the newly spawned process.

The issue with your __getattribute__ implementation for run is that:

run is retrieved during serialization: When multiprocessing tries to pickle your Process object to send to the new process, it will likely access the run attribute. This triggers your __getattribute__ wrapper, which then tries to bind run_wrapper to self.
run_wrapper is bound to the parent process's self: The run_wrapper closure, when created in the parent process, captures the self (the Process instance) from the parent's memory space.
Deserialization creates a new object: In the child process, a new Process object is created by deserializing the pickled data. However, the run_wrapper method that was pickled still holds a reference to the self from the parent process. This is a subtle but critical distinction.
The child's run is not your wrapped run: When the child process starts, it internally calls its own run method. Because of the serialization and deserialization process, the run method that's ultimately executed in the child process is the original multiprocessing.Process.run or the Process.run if you had directly overridden it. Your __getattribute__ magic, which wraps run, isn't correctly applied to the Process object within the child's context.

* Cleanup

* Logging bugfix (#18465)

* use mp Manager to handle logging queues

A Python bug (https://github.com/python/cpython/issues/91555) was preventing logs from the embeddings maintainer process from printing. The bug is fixed in Python 3.14, but a viable workaround is to use the multiprocessing Manager, which better manages mp queues and causes the logging to work correctly.

* consolidate

* fix typing

* Fix typing

* Use global log queue

* Move to using process for logging

* Convert camera tracking to process

* Add more processes

* Finalize process

* Cleanup

* Cleanup typing

* Formatting

* Remove daemon

---------

Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com>
2025-08-07 20:55:31 -06:00
Nicolas Mowen
f791b0c8e7 Dynamic Management of Cameras (#18671)
* Add base class for global config updates

* Add or remove camera states

* Move camera process management to separate thread

* Move camera management fully to separate class

* Cleanup

* Stop camera processes when stop command is sent

* Start processes dynamically when needed

* Adjust

* Leave extra room in tracked object queue for two cameras

* Dynamically set extra config pieces

* Add some TODOs

* Fix type check

* Simplify config updates

* Improve typing

* Correctly handle indexed entries

* Cleanup

* Create out SHM

* Use ZMQ for signaling object detectoin is completed

* Get camera correctly created

* Cleanup for updating the cameras config

* Cleanup

* Don't enable audio if no cameras have audio transcription

* Use exact string so similar camera names don't interfere

* Add ability to update config via json body to config/set endpoint

Additionally, update the config in a single rather than multiple calls for each updated key

* fix autotracking calibration to support new config updater function

---------

Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com>
2025-08-07 20:54:18 -06:00
Nicolas Mowen
ad5076f645 Refactor TensorRT (#18643)
* Combine base and arm trt detectors

* Remove unused deps for amd64 build

* Add missing packages and cleanup ldconfig

* Expand packages for tensorflow model training

* Cleanup

* Refactor training to not reserve memory
2025-08-07 20:53:50 -06:00
Josh Hawkins
2692eb4830 Make Birdseye clickable (#18628)
* keep track of layout changes and publish on change

* websocket hook

* clickable overlay div to navigate to full camera view
2025-08-07 20:53:13 -06:00
FL42
b032b70c5e fix: Initialize GenAI client if GenAI is enabled globally (#18623) 2025-08-07 20:53:13 -06:00
FL42
1b74b0d5ea feat: enable using GenAI for cameras with GenAI disabled from the API (#18616) 2025-08-07 20:53:13 -06:00
Jimmy
2a30acaa0d Add Mesa Teflon as a TFLite detector (#18310)
* Refactor common functions for tflite detector implementations

* Add detector using mesa teflon delegate

Non-EdgeTPU TFLite can use the standard .tflite format

* Add mesa-teflon-delegate from bookworm-backports to arm64 images
2025-08-07 20:53:13 -06:00
Nicolas Mowen
e87c99946f Classification Model Metrics (#18595)
* Add speed and rate metrics for custom classification models

* Use metrics for classification models

* Use keys

* Cast to list
2025-08-07 20:53:13 -06:00
Nicolas Mowen
698b782ecc Live classification model training (#18583)
* Implement model training via ZMQ and add model states to represent training

* Get model updates working

* Improve toasts and model state

* Clean up logging

* Add back in
2025-08-07 20:53:13 -06:00
Nicolas Mowen
83c4fb5710 Classification Model UI (#18571)
* Setup basic training structure

* Build out route

* Handle model configs

* Add image fetch APIs

* Implement model training screen with dataset selection

* Implement viewing of training images

* Adjust directories

* Implement viewing of images

* Add support for deleting images

* Implement full deletion

* Implement classification model training

* Improve naming

* More renaming

* Improve layout

* Reduce logging

* Cleanup
2025-08-07 20:53:13 -06:00
Josh Hawkins
595f94e1c8 Audio transcription tweaks (#18540)
* use model runner

* unload whisper model when live transcription is complete
2025-08-07 20:53:13 -06:00
Josh Hawkins
97bea8487d Upgrade PaddleOCR models to v4 (rec) and v5 (det) (#18505)
The PP_OCRv5 text detection models have greatly improved over v3. The v5 recognition model makes improvements to challenging handwriting and uncommon characters, which are not necessary for LPR, so using v4 seemed like a better choice to continue to keep inference time as low as possible. Also included is the full dictionary for Chinese character support.
2025-08-07 20:53:13 -06:00
Nicolas Mowen
21807ca255 Tiered recordings (#18492)
* Implement tiered recording

* Add migration for record config

* Update docs

* Update reference docs

* Fix preview query

* Fix incorrect accesses

* Fix

* Fix

* Fix

* Fix
2025-08-07 20:53:13 -06:00
Nicolas Mowen
4806575b25 Intel updates (#18493)
* Update openvino and onnxruntime

* Install icd and level-zero-gpu deps from intel directly

* Install

* Add dep

* Fix package install
2025-08-07 20:53:13 -06:00
Nicolas Mowen
97f971abee Implement API to train classification models (#18475) 2025-08-07 20:53:13 -06:00
Josh Hawkins
8911568fdf Audio transcription support (#18398)
* install new packages for transcription support

* add config options

* audio maintainer modifications to support transcription

* pass main config to audio process

* embeddings support

* api and transcription post processor

* embeddings maintainer support for post processor

* live audio transcription with sherpa and faster-whisper

* update dispatcher with live transcription topic

* frontend websocket

* frontend live transcription

* frontend changes for speech events

* i18n changes

* docs

* mqtt docs

* fix linter

* use float16 and small model on gpu for real-time

* fix return value and use requestor to embed description instead of passing embeddings

* run real-time transcription in its own thread

* tweaks

* publish live transcriptions on their own topic instead of tracked_object_update

* config validator and docs

* clarify docs
2025-08-07 20:53:12 -06:00
Nicolas Mowen
cf0a6f091b Fix incorrectly running lpr (#18390) 2025-08-07 20:52:58 -06:00
Nicolas Mowen
359b4a5630 Add basic config editor when Frigate can't startup (#18383)
* Start Frigate in safe mode when config does not validate

* Add safe mode page that is just the config editor

* Adjust Frigate config editor when in safe mode

* Cleanup

* Improve log message
2025-08-07 20:52:57 -06:00
Nicolas Mowen
80dec7dfa1 Add ability to configure when custom classification models run (#18380)
* Add config to control when classification models are run

* Cleanup
2025-08-07 20:52:32 -06:00
Nicolas Mowen
dd75803063 Update ROCm to 6.4.1 (#18364)
* Update rocm to 6.4.1

* Quick fix
2025-08-07 20:52:32 -06:00
Josh Hawkins
08b98330f8 Implement support for no recordings indicator on timeline (#18363)
* Indicate no recordings on the history timeline with gray hash marks

This commit includes a new backend API endpoint and the frontend changes needed to support this functionality

* don't show slashes for now
2025-08-07 20:52:32 -06:00