mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-11-20 12:33:00 +03:00
Miscellaneous fixes (#24996)
CI / AMD64 Build (push) Canceled after 0s
CI / AMD64 Smoke Test (push) Canceled after 0s
CI / ARM Build (push) Canceled after 0s
CI / Jetson Jetpack 6 (push) Canceled after 0s
CI / AMD64 Extra Build (push) Canceled after 0s
CI / ARM Extra Build (push) Canceled after 0s
CI / Synaptics Build (push) Canceled after 0s
CI / Assemble and push default build (push) Canceled after 0s
CI / AMD64 Build (push) Canceled after 0s
CI / AMD64 Smoke Test (push) Canceled after 0s
CI / ARM Build (push) Canceled after 0s
CI / Jetson Jetpack 6 (push) Canceled after 0s
CI / AMD64 Extra Build (push) Canceled after 0s
CI / ARM Extra Build (push) Canceled after 0s
CI / Synaptics Build (push) Canceled after 0s
CI / Assemble and push default build (push) Canceled after 0s
* tweak agents file * add serbian latin * fix serbian latin components weblate put them in the wrong directory (sr_Latn). the component style was updated in weblate itself so this shouldn't happen for any future translations * raise on empty genai embedding response so the maintainer thread survives
This commit is contained in:
@@ -6,7 +6,7 @@ This document provides coding guidelines and best practices for contributing to
|
|||||||
|
|
||||||
Frigate NVR is a realtime object detection system for IP cameras that uses:
|
Frigate NVR is a realtime object detection system for IP cameras that uses:
|
||||||
|
|
||||||
- **Backend**: Python 3.13+ with FastAPI, OpenCV, TensorFlow/ONNX
|
- **Backend**: Python 3.11 with FastAPI, OpenCV, TensorFlow/ONNX
|
||||||
- **Frontend**: React with TypeScript, Vite, TailwindCSS
|
- **Frontend**: React with TypeScript, Vite, TailwindCSS
|
||||||
- **Architecture**: Multiprocessing design with ZMQ and MQTT communication
|
- **Architecture**: Multiprocessing design with ZMQ and MQTT communication
|
||||||
- **Focus**: Minimal resource usage with maximum performance
|
- **Focus**: Minimal resource usage with maximum performance
|
||||||
@@ -23,7 +23,7 @@ When reviewing code, do NOT comment on:
|
|||||||
|
|
||||||
### Python Requirements
|
### Python Requirements
|
||||||
|
|
||||||
- **Compatibility**: Python 3.13+
|
- **Compatibility**: Python 3.11 (the version in the Docker image)
|
||||||
- **Language Features**: Use modern Python features:
|
- **Language Features**: Use modern Python features:
|
||||||
- Pattern matching
|
- Pattern matching
|
||||||
- Type hints (comprehensive typing preferred)
|
- Type hints (comprehensive typing preferred)
|
||||||
@@ -97,11 +97,12 @@ When reviewing code, do NOT comment on:
|
|||||||
|
|
||||||
### Async Programming
|
### Async Programming
|
||||||
|
|
||||||
- **External I/O**: All external I/O operations must be async
|
- **Scope**: Frigate is mostly synchronous multiprocess code, and most API handlers are plain `def` running in FastAPI's threadpool. These rules apply to code that is already `async def`.
|
||||||
- **Best Practices**:
|
- **Blocking I/O**: A handler that does blocking work (peewee queries, `requests`, subprocess) should be a plain `def`, not an `async def` that blocks the event loop
|
||||||
- Avoid sleeping in loops - use `asyncio.sleep()` not `time.sleep()`
|
- **Best Practices** (inside `async def`):
|
||||||
|
- Use `asyncio.sleep()`, not `time.sleep()`
|
||||||
- Avoid awaiting in loops - use `asyncio.gather()` instead
|
- Avoid awaiting in loops - use `asyncio.gather()` instead
|
||||||
- No blocking calls in async functions
|
- No blocking calls
|
||||||
- Use `asyncio.create_task()` for background operations
|
- Use `asyncio.create_task()` for background operations
|
||||||
- **Thread Safety**: Use proper synchronization for shared state
|
- **Thread Safety**: Use proper synchronization for shared state
|
||||||
|
|
||||||
|
|||||||
@@ -68,6 +68,10 @@ class GenAIEmbedding:
|
|||||||
f"Invalid embedding_type '{embedding_type}'. Must be 'text' or 'vision'."
|
f"Invalid embedding_type '{embedding_type}'. Must be 'text' or 'vision'."
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Callers index the result, so an empty provider response must raise
|
||||||
|
if not embeddings:
|
||||||
|
raise ValueError(f"Empty {embedding_type} embedding response from provider")
|
||||||
|
|
||||||
result = []
|
result = []
|
||||||
for emb in embeddings:
|
for emb in embeddings:
|
||||||
arr = np.asarray(emb, dtype=np.float32)
|
arr = np.asarray(emb, dtype=np.float32)
|
||||||
|
|||||||
@@ -216,6 +216,7 @@
|
|||||||
"hr": "Hrvatski (Croatian)",
|
"hr": "Hrvatski (Croatian)",
|
||||||
"bs": "Bosanski (Bosnian)",
|
"bs": "Bosanski (Bosnian)",
|
||||||
"sr": "Српски (Serbian)",
|
"sr": "Српски (Serbian)",
|
||||||
|
"srLatn": "Srpski (Serbian, Latin)",
|
||||||
"sl": "Slovenščina (Slovenian)",
|
"sl": "Slovenščina (Slovenian)",
|
||||||
"lt": "Lietuvių (Lithuanian)",
|
"lt": "Lietuvių (Lithuanian)",
|
||||||
"bg": "Български (Bulgarian)",
|
"bg": "Български (Bulgarian)",
|
||||||
|
|||||||
@@ -115,6 +115,7 @@ export default function GeneralSettings({
|
|||||||
"zh-CN": "zhCN",
|
"zh-CN": "zhCN",
|
||||||
"zh-Hant": "zhHant",
|
"zh-Hant": "zhHant",
|
||||||
"pt-BR": "ptBR",
|
"pt-BR": "ptBR",
|
||||||
|
"sr-Latn": "srLatn",
|
||||||
};
|
};
|
||||||
|
|
||||||
return supportedLanguageKeys.map((key) => {
|
return supportedLanguageKeys.map((key) => {
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ const localeMap: Record<string, () => Promise<Locale>> = {
|
|||||||
ca: () => import("date-fns/locale/ca").then((module) => module.ca),
|
ca: () => import("date-fns/locale/ca").then((module) => module.ca),
|
||||||
hr: () => import("date-fns/locale/hr").then((module) => module.hr),
|
hr: () => import("date-fns/locale/hr").then((module) => module.hr),
|
||||||
bs: () => import("date-fns/locale/bs").then((module) => module.bs),
|
bs: () => import("date-fns/locale/bs").then((module) => module.bs),
|
||||||
|
"sr-Latn": () =>
|
||||||
|
import("date-fns/locale/sr-Latn").then((module) => module.srLatn),
|
||||||
sl: () => import("date-fns/locale/sl").then((module) => module.sl),
|
sl: () => import("date-fns/locale/sl").then((module) => module.sl),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ export const supportedLanguageKeys = [
|
|||||||
"pl",
|
"pl",
|
||||||
"hr",
|
"hr",
|
||||||
"bs",
|
"bs",
|
||||||
|
"sr-Latn",
|
||||||
"sk",
|
"sk",
|
||||||
"sl",
|
"sl",
|
||||||
"lt",
|
"lt",
|
||||||
|
|||||||
Reference in New Issue
Block a user