Commit Graph

221 Commits

Author SHA1 Message Date
Nicolas Mowen
b88fa9ece6
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-07-18 09:28:02 -05:00
Josh Hawkins
d97b451d12
Optionally show tracked object paths in debug view (#19025) 2025-07-07 09:33:19 -05:00
Josh Hawkins
57bb0cc397
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-07-07 09:03:57 -05:00
Nicolas Mowen
6f16ecdd48
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-06-11 12:25:30 -05:00
FL42
76201c0c7f
feat: enable using GenAI for cameras with GenAI disabled from the API (#18616) 2025-06-07 13:43:29 -05:00
Nicolas Mowen
be8ee068e2
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-06-05 09:13:12 -06:00
Nicolas Mowen
85d721eb6b
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-06-04 18:09:55 -05:00
Nicolas Mowen
20e0addae1
Implement API to train classification models (#18475) 2025-05-29 17:51:32 -06:00
Josh Hawkins
2bd6fa53fe
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-05-27 10:26:00 -05:00
Josh Hawkins
9392ffc300
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-05-23 08:55:48 -06:00
Nicolas Mowen
5dd30b273a
Dynamically update masks and zones for cameras (#18359)
* Include config publisher in api

* Call update topic for passed topics

* Update zones dynamically

* Update zones internally

* Support zone and mask reset

* Handle updating objects config

* Don't put status for needing to restart Frigate

* Cleanup http tests

* Fix tests
2025-05-22 20:51:23 -06:00
Josh Hawkins
49c6073de6
Add ability to specify separator used in proxy headers (#18336) 2025-05-21 06:02:13 -06:00
Nicolas Mowen
f48356cbee
Fixes (#18245)
* Only check if an object is stationary to avoid mqtt snapshot

* docs heading tweak

* Add more API descriptions

* Add missing lib for new rocm onnxruntime whl

* Update inference times to reflect better rocm performance

* Cleanup resetting tracked object activity

* remove print

---------

Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com>
2025-05-15 17:13:18 -05: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
8094dd4075
Fixes (#18117)
* face library i18n fixes

* face library i18n fixes

* add ability to use ctrl/cmd S to save in the config editor

* Use datetime as ID

* Update metrics inference speed to start with 0 ms

* fix android formatted thumbnail

* ensure role is comma separated and stripped correctly

* improve face library deletion

- add a confirmation dialog
- add ability to select all / delete faces in collections

* Implement lazy loading for video previews

* Force GPU for large embedding model

* GPU is required

* settings i18n fixes

* Don't delete train tab

* webpush debugging logs

* Fix incorrectly copying zones

* copy path data

* Ensure that cache dir exists for Frigate+

* face docs update

* Add description to upload image step to clarify the image

* Clean up

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2025-05-09 07:36:44 -06:00
Josh Hawkins
ac8e647b92
Fixes (#18077)
* fix onvif reinitialization

* api docs: clarify usage of clip.mp4 endpoint

* Always show train tab

* Add description to API

* catch lpr model inference exceptions

* always apply motion mask when using yolov9 plate detection

* lpr faq

* fix incorrect focus when reopening search detail dialog on video tab

* only use keyboard listener in face library when train tab is active

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2025-05-07 16:31:24 -06:00
Josh Hawkins
da1fb935b4
Refactor async ONVIF (#18093)
* use async/await instead of asyncio.run()

* fix autotracking

* create cameras in same event loop that will use them

* more debug

* try using existing event loop instead of creating a new one

* merge dev

* fixes

* run get_camera_info onvifcontroller calls in dedicated loop

* move coroutine call with loop to api

* use asyncio for autotracking move queues

* clean up

* fix calibration

* improve exception logging
2025-05-07 07:53:29 -06:00
Josh Hawkins
511542eaf8
Fixes (#18055)
* frigate+ pane i18n fix

* catch more exceptions

* explore search result tooltip i18n fix

* i18n fix

* remove comments about deprecated strftime_fmt

* Catch producers exists but is None

* Formatting

* fix live camera view i18n

* Add default role config for proxy users

This allows users to specify a default role for users when using a proxy for auth. This can be useful for users who can't/don't want to define a header mapping for the remote-role header.

* update reference config and auth docs

* clarify face rec camera level config

* clarify auth docs

* Fix onnx not working with openvino

* Update openvino to fix failed npu plugin check

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2025-05-05 20:42:24 -06:00
Josh Hawkins
d11f46bbce
Add ability to rename faces in the Face Library (#17879)
* api endpoint

* embeddings rename function

* frontend and i18n keys

* lazy load train tab images

* only log exception to make codeql happy
2025-04-23 17:27:46 -06:00
Josh Hawkins
b061d083ba
Misc fixes (#17871)
* fix check for snapshot score

for manual events, snapScore is 0, so "0" gets displayed instead of a condition being evaluated.

* fix ongoing events from being returned for all review queries

The existing condition will include any record with a null end_time regardless of when it started, as long as the start_time is greater than the after param. With this fix, both the start time needs to be within the specified range, and for events that have already ended, their end time must be before the before param

* Base alert toggles on width not device class

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2025-04-23 07:06:31 -06:00
Josh Hawkins
a91a2ce4ca
Don't limit review summary query (#17835)
* Don't limit review summary query

The /review/summary endpoint was being restricted to the last 30 days, so unreviewed alerts and detections weren't showing in the calendar before that point. This change removes the WHERE clause so that the endpoint returns all results.

* fix

* remove unneeded test

we are now returning all results so we don't need to test for > month_ago

* fix
2025-04-21 11:09:01 -06:00
Josh Hawkins
64db518837
Edit license plate in Tracked Object Details (#17631)
* api endpoint

* frontend

* only allow admins to edit sub labels and plates
2025-04-10 08:27:01 -06:00
Josh Hawkins
049c5cfa9d
Fix search sort when using score or estimated speed (#17629) 2025-04-10 07:07:50 -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
bda7fcc784
use ceil instead of round for recording snapshot (#17444) 2025-03-29 06:19:12 -06:00
Nicolas Mowen
4aa493b96c
Catch case where frame time is between end and rounded start (#17438) 2025-03-28 21:37:11 -05:00
Nicolas Mowen
b14abffea3
Refactor face library page (#17424)
* Section faces by event id

* Make score keeping more robust

* layout improvements

* Cleanup dialog

* Fix clicking behavior

* Add view in explore option

* math.round

* Don't require events

* Cleanup

* Remove selection

* Don't require

* Change dialog size with snapshot

* Use filename as key

* fix key

* Rework layout for mobile

* Handle mobile landscape

* Fix train issue

* Match logic

* Move deletion logic

* Fix reprocessing

* Support creating a new face

* Translations

* Do sorting in frontend

* Adjust unknown

* Cleanup

* Set max limit to faces to recognize

* Fix sorting

* Fix
2025-03-28 13:52:12 -05:00
Josh Hawkins
23c3323871
Dynamic embeddings reindexing (#17418)
* reindex with api endpoint and zmq

* threading

* frontend

* require admin role
2025-03-27 11:29:34 -06:00
Nicolas Mowen
e6936c177b
Face model loading improvements (#17390)
* Don't assume landmark file is downloaded

* Rewrite build model task to be asynchronous so it doesn't block the pipeline

* Handle case where face recognition does not respond

* Cleanup

* Make daemon thread
2025-03-26 10:00:23 -06:00
leccelecce
05d39f79b0
Add ability to update Frigate+ model to latest from UI (#17324)
* Add ability to update Frigate+ model to latest

* UI tweaks

* further UI tweaks

* UI tweaks: add width and height, fix select

* Add placeholder while API call in progress

* Fix Frigate+ enabled check

* Fix config change lost when reloading page

* Add persistent message requiring restart

* Drop down supported detectors and dimensions

* Add width and height to display

* Update FrigatePlusSettingsView.tsx

* Temp fix for Codespaces not loading

* Add i18n, format

* remove unneeded brackets

* missing colon

* Revert "Temp fix for Codespaces not loading"

This reverts commit 75b19674ce.
2025-03-24 09:19:58 -06:00
Felipe Santos
f8b0329b37
Move database and config from homeassistant /config to addon /config (#16337)
* Move database and config from homeassistant /config to addon /config

* Re-implement config migration for the add-on

* Align some terms

* Improve function name

* Use local variables

* Add model.path migration

* Fix homeassistant config path

* Ensure migration scripts run before go2rtc and frigate

* Migrate all files I know

* Add ffmpeg.path migration

* Update docker/main/rootfs/etc/s6-overlay/s6-rc.d/prepare/run

Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com>

* Improve some variable names and organization

* Update docs to reflect addon config dir

* Update live.md with /addon_configs

* Move addon config section to configuration doc

* Align several terminologies and improve text

* Fix webrtc example config title

* Capitalize Add-on in more places

* Improve specific add-on config dir docs

* Align bash and python scripts to prefer config.yml over config.yaml

* Support config.json in migration shell scripts

* Change docs to reflect config.yml is preferred over config.yaml

* If previous config was yaml, migrate to yaml

* Fix typo in edgetpu.md

* Fix formatting of Python files

* Remove HailoRT Beta add-on variant from docs

* Add migration for labelmap and certs

* Fix variable name

* Fix new_config_file var unset

* Fix addon config directories table

* Improve db migration to avoid migrating files like .db.bak

* Fix echo location

---------

Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com>
2025-03-24 09:05:59 -05:00
Nicolas Mowen
08cf0def6e
Face tweaks (#17290)
* Ensure doesn't fail due to missing dir

* Remove redundant settings from tabs

* Adjust selection method for mobile

* Fix button descendent error

* Ensure train is option on mobile

* Cleanup face images

* Cleanup
2025-03-21 12:47:32 -05:00
Nicolas Mowen
060659044e
Quick fixes (#17278)
* Fix check

* Fix default loading state
2025-03-20 15:09:57 -05:00
Nicolas Mowen
e396043f79
Don't log go2rtc failure when camera is disabled (#17277) 2025-03-20 13:38:18 -05:00
Nicolas Mowen
e33fa96599
Face recognize api (#17233)
* Add api to run face recognition on image

* Rework save attempts option

* Cleanup mobile object pane buttons

* Adjust api signature

* Remove param

* Cleanup
2025-03-19 09:02:25 -06:00
leccelecce
dda7be99eb
Face rec: only consider webp files in /faces and handle_request (#17244)
* Face rec: only consider webp files

* Allow png/jpg/jpeg as well as webp
2025-03-19 06:44:07 -06:00
Logan Garrett
cf16eda76e
Fix key error when model path key doesn't exist. (#17217)
* fixed metrics race condition

* ruff formatting

* adjust for default path config

* ruff

* check for model too
2025-03-17 22:01:40 -05:00
Nicolas Mowen
bf22d89f67
Improve Face Library Management (#17213)
* Set maximum number of face images to be kept

* Fix vertical camera scaling

* adjust wording

* Add attributes to search data

* Add button to train face from event

* Handle event id saving in API
2025-03-17 16:57:46 -05:00
Josh Hawkins
fad62b996a
Add Frigate+ pane to Settings UI (#17208)
* add plus data to config api response

* add fields to frontend type

* add frigate+ page in settings

* add docs

* fix label in explore detail dialog
2025-03-17 13:44:57 -05:00
Josh Hawkins
d87268acfe
Small tweaks (#17168)
* Clean up repeated code in auth

* Ensure review status is migrated for anonymous users
2025-03-15 07:11:45 -06:00
Nicolas Mowen
fbd22c8124
Cleanup bird classification (#17146)
* Cleanup bird classification

* Cleanup
2025-03-14 07:21:50 -06:00
Nicolas Mowen
759d963a04
Cleanup typing (#17145) 2025-03-14 08:10:47 -05:00
Josh Hawkins
8a17e2bfbf
implement onvif retry mechanism (#17144) 2025-03-14 07:25:48 -05:00
Josh Hawkins
bf311e6467
Simplify auth check (#17138)
* simplify get_current_user

* add sanity check
2025-03-13 16:01:15 -05:00
Josh Hawkins
4f6d70ded0
Review items per user (#17137)
* model

* migration

* api changes

* delete in cleanup

* fix tests
2025-03-13 14:20:09 -06: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
MkSavin
bea6cf29c2
fix(auth): Added trimming to jwt secret token read from .jwt_secret (#16467)
Added cleaning of leading and trailing spaces and special characters from a line when reading a secret token from a `.jwt_secret` file
2025-03-10 16:36:43 -06:00