Commit Graph

31 Commits

Author SHA1 Message Date
Josh Hawkins
0ee32cf110
Fix yaml bug and ensure embeddings progress doesn't show until all models are loaded (#14338) 2024-10-14 08:23:08 -06:00
Nicolas Mowen
8ade85edec
Restructure embeddings (#14266)
* Restructure embeddings

* Use ZMQ to proxy embeddings requests

* Handle serialization

* Formatting

* Remove unused
2024-10-10 09:42:24 -06:00
Josh Hawkins
3688a3bc67
Misc fixes (#14064)
* Add loading indicator when explore view is revalidating

* Portal tooltip in object lifecycle pane

* Better config file handling

* Only manually set aspect ratio when using alert videos
2024-09-30 07:32:54 -06:00
gtsiam
dc54981784
Move more things out of FrigateApp (#13897)
* Moved FrigateApp.init_config() into FrigateConfig.load()

* Move frigate config loading into main

* Store PlusApi in FrigateConfig

* Register SIGTERM handler in main

* Ensure logging is setup during config parsing

* Removed pointless try

* Moved config initialization out of FrigateApp

* Made FrigateApp.shm_frame_count into a function

* Removed log calls from signal handlers

python's logging calls are not re-entrant, which caused at least one of
these to deadlock randomly.

* Reopen stdout/err on process fork

This helps avoid deadlocks (https://github.com/python/cpython/issues/91776).

* Make mypy happy

* Whoops. I might have forgotten to save.

Truly an amateur mistake.

* Always call FrigateApp.stop()
2024-09-24 07:07:47 -05:00
gtsiam
e8763b3697
Removed usage of PyYAML for config parsing. (#13883)
* Ignore entire __pycache__ folder instead of individual *.pyc files

* Ignore .mypy_cache in git

* Rework config YAML parsing to use only ruamel.yaml

PyYAML silently overrides keys when encountering duplicates, but ruamel
raises and exception by default. Since we're already using it elsewhere,
dropping PyYAML is an easy choice to make.

* Added EnvString in config to slim down runtime_config()

* Added gitlens to devcontainer

* Automatically call FrigateConfig.runtime_config()

runtime_config needed to be called manually before. Now, it's been
removed, but the same code is run by a pydantic validator.

* Fix handling of missing -segment_time

* Removed type annotation on FrigateConfig's parse

I'd like to keep them, but then mypy complains about some fundamental
errors with how the pydantic model is structured. I'd like to fix it,
but I'd rather work towards moving some of this config to the database.
2024-09-22 10:56:57 -05:00
Josh Hawkins
ff9e1da1de
Revert "Rewrite yaml loader (#13803)" (#13805)
This reverts commit 38ff46e45c.
2024-09-17 15:03:22 -06:00
gtsiam
38ff46e45c
Rewrite yaml loader (#13803)
* Ignore entire __pycache__ folder instead of individual *.pyc files

* Rewrite the yaml loader to match PyYAML

The old implementation would fail in weird ways with configs that were
incorrect in just the right way. The new implementation just does what
PyYAML would do, only diverging in case of duplicate keys.

* Clarify duplicate yaml key ValueError message

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2024-09-17 15:52:55 -05:00
Josh Hawkins
ddf9163c47
Implement object lifecycle pane (#13550)
* Object lifecycle pane

* fix thumbnails and annotation offset math

* snapshot endpoint height and format, yaml types, bugfixes

* clean up for new type

* use get_image_from_recording in recordings snapshot api

* make height optional
2024-09-04 07:46:49 -06:00
Josh Hawkins
a0741aa7b1
Remove matplotlib and generate color palette to mimic matplotlib's colors (#12327) 2024-07-07 12:53:00 -06:00
Blake Blackshear
b4384a1be3
Shutdown hang (#11793)
* intentionally handle queues during shutdown and carefully manage shutdown order

* more carefully manage shutdown to avoid threadlocks

* use debug for signal logging

* ensure disabled cameras dont break shutdown

* typo
2024-06-06 18:54:38 -05:00
Josh Hawkins
3f171e7670
bugfixes (#11526) 2024-05-25 20:37:53 -06:00
Nicolas Mowen
4d05bc25f4
Safely load config file for go2rtc (#11491)
* Safely load config file for go2rtc

* Add log for default config

* Cleanup
2024-05-22 18:10:55 -05:00
Nicolas Mowen
8230813b79
Migrate export filenames (#11005)
* Migrate export filenames

* formatting

* Remove test.yaml saving
2024-04-17 16:26:16 -05:00
Nicolas Mowen
07ee39b9b8
Write default config if no config is saved (#10847) 2024-04-05 08:39:43 -05:00
Nicolas Mowen
8776cdfd5b
Tweaks fixes (#10311)
* Save numbers as int instead of string

* Fix hover logic

* Fix delay for new alerts

* Fixup dialog and marking item as uploaded

* Make preview progress larger and easier to grab

* Allow hovering to control preview on desktop
2024-03-07 08:34:11 -06:00
Nicolas Mowen
3d90f50d84
Ability to add, edit, and delete camera groups in the UI (#10296)
* Add dialog for creating new camera group

* Support adding of camera groups and dynamically updating the config

* Support deleting and edit existing camera groups

* Don't show separator if user has no groups

* Formatting

* fix background
2024-03-06 19:15:50 -06:00
Nicolas Mowen
fa0f509e18
Fix case where model path is set but not labelmap path (#10215) 2024-03-03 18:17:56 -06:00
Nicolas Mowen
3c4b1fb6f2
Update flask and restructure into api folder with apis put into separate folders (#10193)
* Update flask

* Update flask and break apart different sections into different files

* formatting

* Fix test and add safety check
2024-03-02 22:10:37 +00:00
Nicolas Mowen
18062eca06
Don't fail when tz is incorrect (#8723)
* Don't fail when tz is incorrect

* Fix import
2023-11-23 11:43:02 +00:00
Nicolas Mowen
ca84732574
Ensure storage cleanup doesn't fail (#8531) 2023-11-07 23:21:43 +00:00
tpjanssen
3359123364
Performance increase with lots of recordings (#8525)
* Performance increase with lots of recordings

* Formatting + review

* Update 020_update_index_recordings.py

Formatting

* Feedback + check fix

* Update 020_update_index_recordings.py
2023-11-07 23:18:26 +00:00
Nicolas Mowen
63233a5830
Periodically sync for stale recordings (#8433)
* Periodically cleanup recordings files / DB

* Make automatic sync limited ot last 36 hours
2023-11-04 02:21:29 +00:00
Blake Blackshear
d1620b4e39
clean passwords when both rtsp and http present (#8399) 2023-10-31 08:04:42 -05:00
Nicolas Mowen
91f7d67c5e
Smarter Regions (#8194)
* Smarter Regions

* Formatting

* Cleanup

* Fix motion region checking logic

* Add database table and migration for regions

* Update region grid on startup

* Revert init delay change

* Fix mypy

* Move object related functions to util

* Remove unused

* Fix tests

* Remove log

* Update the region daily at 2

* Fix logic

* Formatting

* Initialize grid before starting processing frames

* Move back to creating grid in main process

* Formatting

* Fixes

* Formating

* Fix region check

* Accept all but true

* Use regions grid for startup scan

* Add clarifying comment

* Fix new grid requests

* Add tests

* Delete stale region grids from DB
2023-10-18 18:21:52 -05:00
Blake Blackshear
14d2b79c72
Security fixes (#8081)
* use safeloader

* use json responses wherever possible

* remove CORS and add CSRF token

* formatting fixes

* add envjs back

* fix baseurl test
2023-10-06 22:20:30 -05:00
Josh Hawkins
27144eb0b9
Autotracker: Basic zooming and moves with velocity estimation (#7713)
* don't zoom if camera doesn't support it

* basic zooming

* make zooming configurable

* zooming docs

* optional zooming in camera status

* Use absolute instead of relative zooming

* increase edge threshold

* zoom considering object area

* bugfixes

* catch onvif zooming errors

* relative zooming option for dahua/amcrest cams

* docs

* docs

* don't make small movements

* remove old logger statement

* fix small movements

* use enum in config for zooming

* fix formatting

* empty move queue first

* clear tracked object before waiting for stop

* use velocity estimation for movements

* docs updates

* add tests

* typos

* recalc every 50 moves

* adjust zoom based on estimate box if calibrated

* tweaks for fast objects and large movements

* use real time for calibration and add info logging

* docs updates

* remove area scale

* Add example video to docs

* zooming font header size the same as the others

* log an error if a ptz doesn't report a MoveStatus

* debug logging for onvif service capabilities

* ensure camera supports ONVIF MoveStatus
2023-09-27 06:19:10 -05:00
Sergey Krashevich
731743c7e5
Refactor AudioTfl class to accept the number of detection threads as a parameter in the constructor, and update the usage of the num_threads attribute accordingly (#7588) 2023-09-01 07:00:11 -05:00
Nicolas Mowen
d6f82f9edc
Fix queues (#7087)
* Fix queues

* Change name

* Use standard queue for limited queue

* remove unused

* isort
2023-07-08 06:46:31 -05:00
Sergey Krashevich
30dfdf47d4
Add thread-safety to LimitedQueue by implementing a lock for put and get methods (#7053) 2023-07-06 13:54:55 -05:00
Sergey Krashevich
f48dd8c1ab
Feature: camera debug/config enhancements (#6920)
* Add functionality to update YAML config file with PUT request in HTTP endpoint

* Refactor copying of text to clipboard with Clipboard API and fallback to document.execCommand('copy') in CameraMap.jsx file

* Update YAML file from URL query parameters in frigate/http.py and add functionality to save motion masks, zones, and object masks in CameraMap.jsx

* formatting

* fix merging fuckup

* Refactor camera zone coordinate saving to use single query parameter per zone in CameraMap.jsx

* remove unnecessary print statements in util.py

* Refactor update_yaml_file function to separate the logic for updating YAML data into a new function update_yaml().

* fix merge errors

* Refactor code to improve error handling and add dependencies to useEffect hooks
2023-07-06 13:54:26 -05:00
Nicolas Mowen
baf671b764
Cleanup and organize utils (#7033)
* Force birdseye cameras into standard aspect ratios

* Organize utils

* Update tests

* Formatting

* Isort

* Fix tests

* Cleanup

* isort
2023-07-06 09:28:50 -05:00