Commit Graph

215 Commits

Author SHA1 Message Date
Nicolas Mowen
3eb3797bc5
Update API schema to latest (#19156)
* Add description to snapshot api

* Update API schema
2025-07-15 21:53:21 -05:00
Nicholas Cook
4b72c86e77
Fix IPv6 addresses with IPv4 trusted proxies (#19134)
When an IPv6 address that doesn't map to an IPv4 address was checked
against an IPv4 trusted proxy, we'd hit an exception because
ip.ipv4_mapped was None. Fix this by verifying ipv4_mapped is not None

Co-authored-by: me <me@me>
2025-07-13 20:43:25 -06:00
Nicolas Mowen
ea576e7468
Fixes (#18897)
* Fix showing review items that span over multiple days

* Simplify

* Fix tests

* Fix unchanged value

* Allow admin as default role and viewer as passed header for proxy auth

---------

Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com>
2025-06-26 13:01:09 -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
dba9206898
Fixes (#18500)
* fix i18n keys

* hide disable from context menu for viewers

* Fix auto live check for default dashboard and camera groups

Disabling the Automatic Live View switch in Settings should prevent streaming from occurring. Overriding any settings in a camera group will override the global setting. The check here incorrectly always returned false instead of undefined.

* clarify hardware accelerated enrichments

* clarify

* add note about detect stream to face rec docs

* add note about low end Dahuas for autotracking

* Catch invalid face box / image

* Video tab tweaks

With the changes in https://github.com/blakeblackshear/frigate/pull/18220, the video tab in the Tracked Object Details pane now correctly trims the in-browser HLS video. Because of keyframes and record/detect stream differences, we can manually subtract a couple of seconds from the event start_time to ensure the first few frames aren't cut off from the video

* Clarify

* Don't use Migraphx by default

* Provide better support for running embeddings on GPU

* correctly join cameras

* Adjust blur confidence reduction

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2025-06-03 06:33:32 -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
Nicolas Mowen
0cc5d66e5b
Refactor sub label api (#17079)
* Use event metadata updater to handle sub label operations

* Use event metadata publisher for sub label setting

* Formatting

* fix tests

* Cleanup
2025-03-10 16:29:29 -06:00
Josh Hawkins
2be5225440
More auth role fixes (#17067)
* simplify check and handle comma separated roles

* spacing
2025-03-10 10:00:35 -05:00
Josh Hawkins
cb25bd4a88
Auth role bugfixes (#17066)
* get correct role from header map

* fix profile endpoint
2025-03-10 07:59:24 -06:00
Josh Hawkins
74ca009b0b
UI viewer role (#16978)
* db migration

* db model

* assign admin role on password reset

* add role to jwt and api responses

* don't restrict api access for admins yet

* use json response

* frontend auth context

* update auth form for profile endpoint

* add access denied page

* add protected routes

* auth hook

* dialogs

* user settings view

* restrict viewer access to settings

* restrict camera functions for viewer role

* add password dialog to account menu

* spacing tweak

* migrator default to admin

* escape quotes in migrator

* ui tweaks

* tweaks

* colors

* colors

* fix merge conflict

* fix icons

* add api layer enforcement

* ui tweaks

* fix error message

* debug

* clean up

* remove print

* guard apis for admin only

* fix tests

* fix review tests

* use correct error responses from api in toasts

* add role to account menu
2025-03-08 10:01:08 -06:00
Martin Weinelt
458134de5d
Reuse constants (#16874) 2025-02-28 21:35:09 -07:00
Josh Hawkins
8d2f461350
Embeddings tweaks (#16864)
* make semantic search optional

* config

* frontend metrics

* docs

* tweak

* fixes

* also check genai cameras for embeddings context
2025-02-28 11:43:08 -07:00