Commit Graph

16 Commits

Author SHA1 Message Date
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
gtsiam
1c24f0054a
Make logging code self-contained (#13785)
* Make logging code self-contained.

Rewrite logging code to use python's builting QueueListener, effectively
moving the logging process into a thread of the Frigate app.

Also, wrap this behaviour in a easy-to-use context manager to encourage
some consistency.

* Fixed typing errors

* Remove todo note from log filter

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

* Do not access log record's msg directly

* Clear all root handlers before starting app

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2024-09-17 08:26:25 -05:00
Aida Syoko
3d612e510c
chore: fix some typos in comments (#11028)
Signed-off-by: alongdate <alongyear@outlook.com>
2024-04-20 06:16:43 -05:00
Nicolas Mowen
d2d1278a4d Remove rtmp (#8941)
* remove rtmp from python

* remove rtmp from nginx

* remove rtmp from docs

* fix test for missing role
2024-01-31 12:56:11 +00:00
Blake Blackshear
ae0aba44dc
Improve tracking (#6516) 2023-05-31 08:12:43 -06:00
Martin Weinelt
ab50d0b006
Add isort and ruff linter (#6575)
* Add isort and ruff linter

Both linters are pretty common among modern python code bases.

The isort tool provides stable sorting and grouping, as well as pruning
of unused imports.

Ruff is a modern linter, that is very fast due to being written in rust.
It can detect many common issues in a python codebase.

Removes the pylint dev requirement, since ruff replaces it.

* treewide: fix issues detected by ruff

* treewide: fix bare except clauses

* .devcontainer: Set up isort

* treewide: optimize imports

* treewide: apply black

* treewide: make regex patterns raw strings

This is necessary for escape sequences to be properly recognized.
2023-05-29 05:31:17 -05:00
Nate Meyer
4383b883c0
Refactor to simplify support for additional detector types (#3656)
* Refactor EdgeTPU and CPU model handling to detector submodules.

* Fix selecting the correct detection device type from the config

* Remove detector type check when creating ObjectDetectProcess

* Fixes after rebasing to 0.11

* Add init file to detector folder

* Rename to detect_api

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

* Add unit test for LocalObjectDetector class

* Add configuration for model inputs
Support transforming detection regions to RGB or BGR.
Support specifying the input tensor shape.  The tensor shape has a standard format ["BHWC"] when handed to the detector, but can be transformed in the detector to match the model shape using the model  input_tensor config.

* Add documentation for new model config parameters

* Add input tensor transpose to LocalObjectDetector

* Change the model input tensor config to use an enumeration

* Updates for model config documentation

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2022-11-03 21:23:09 -05:00
Nicolas Mowen
0a4d658c7f
Ability to enable / disable motion detection via MQTT (#3117)
* Starting working on adding motion toggle

* Add all info to mqtt command

* Send motion to correct funs

* Update mqtt docs

* Fixes for contingencies

* format

* mypy

* Tweak behavior

* Fix motion breaking frames

* Fix bad logic in detect set

* Always set value for motion boxes
2022-04-26 07:29:28 -05:00
Blake Blackshear
93f418ac0b fix process_clip 2022-02-18 21:18:26 -06:00
Blake Blackshear
0e43f452d2 use resolution of clip 2022-02-18 21:18:26 -06:00
Blake Blackshear
0695bb097d revamp process clip 2022-02-18 21:18:26 -06:00
Blake Blackshear
a4b88ac4a7 fix process clip 2021-01-26 21:40:33 -06:00
Blake Blackshear
ec4d048905 upgrade to python3.8 and switch from plasma store to shared_memory 2020-10-18 13:47:13 -05:00
Blake Blackshear
69406343ee allow setting the camera fps if needed 2020-09-17 07:37:27 -05:00
Blake Blackshear
e26308a05b print score info 2020-09-17 07:37:27 -05:00
Blake Blackshear
acb75fa02d refactor and reduce false positives 2020-09-17 07:37:27 -05:00