mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-04 20:09:12 +01:00
Add languages (#21870)
* add persian, croatian, and slovak * i18n * fix formatting due to new version of ruff
This commit is contained in:
parent
06141b900e
commit
21e4b36c7c
@ -73,7 +73,7 @@ def get_faces():
|
||||
face_dict[name] = []
|
||||
|
||||
for file in filter(
|
||||
lambda f: (f.lower().endswith((".webp", ".png", ".jpg", ".jpeg"))),
|
||||
lambda f: f.lower().endswith((".webp", ".png", ".jpg", ".jpeg")),
|
||||
os.listdir(face_dir),
|
||||
):
|
||||
face_dict[name].append(file)
|
||||
@ -582,7 +582,7 @@ def get_classification_dataset(name: str):
|
||||
dataset_dict[category_name] = []
|
||||
|
||||
for file in filter(
|
||||
lambda f: (f.lower().endswith((".webp", ".png", ".jpg", ".jpeg"))),
|
||||
lambda f: f.lower().endswith((".webp", ".png", ".jpg", ".jpeg")),
|
||||
os.listdir(category_dir),
|
||||
):
|
||||
dataset_dict[category_name].append(file)
|
||||
@ -693,7 +693,7 @@ def get_classification_images(name: str):
|
||||
status_code=200,
|
||||
content=list(
|
||||
filter(
|
||||
lambda f: (f.lower().endswith((".webp", ".png", ".jpg", ".jpeg"))),
|
||||
lambda f: f.lower().endswith((".webp", ".png", ".jpg", ".jpeg")),
|
||||
os.listdir(train_dir),
|
||||
)
|
||||
),
|
||||
|
||||
@ -695,7 +695,7 @@ def write_classification_attempt(
|
||||
# delete oldest face image if maximum is reached
|
||||
try:
|
||||
files = sorted(
|
||||
filter(lambda f: (f.endswith(".webp")), os.listdir(folder)),
|
||||
filter(lambda f: f.endswith(".webp"), os.listdir(folder)),
|
||||
key=lambda f: os.path.getctime(os.path.join(folder, f)),
|
||||
reverse=True,
|
||||
)
|
||||
|
||||
@ -539,7 +539,7 @@ class FaceRealTimeProcessor(RealTimeProcessorApi):
|
||||
cv2.imwrite(file, frame)
|
||||
|
||||
files = sorted(
|
||||
filter(lambda f: (f.endswith(".webp")), os.listdir(folder)),
|
||||
filter(lambda f: f.endswith(".webp"), os.listdir(folder)),
|
||||
key=lambda f: os.path.getctime(os.path.join(folder, f)),
|
||||
reverse=True,
|
||||
)
|
||||
|
||||
@ -26,15 +26,16 @@ LOG_HANDLER.setFormatter(
|
||||
|
||||
# filter out norfair warning
|
||||
LOG_HANDLER.addFilter(
|
||||
lambda record: not record.getMessage().startswith(
|
||||
"You are using a scalar distance function"
|
||||
lambda record: (
|
||||
not record.getMessage().startswith("You are using a scalar distance function")
|
||||
)
|
||||
)
|
||||
|
||||
# filter out tflite logging
|
||||
LOG_HANDLER.addFilter(
|
||||
lambda record: "Created TensorFlow Lite XNNPACK delegate for CPU."
|
||||
not in record.getMessage()
|
||||
lambda record: (
|
||||
"Created TensorFlow Lite XNNPACK delegate for CPU." not in record.getMessage()
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
||||
@ -208,8 +208,10 @@ class RecordingMaintainer(threading.Thread):
|
||||
processed_segment_count = len(
|
||||
list(
|
||||
filter(
|
||||
lambda r: r["start_time"].timestamp()
|
||||
< most_recently_processed_frame_time,
|
||||
lambda r: (
|
||||
r["start_time"].timestamp()
|
||||
< most_recently_processed_frame_time
|
||||
),
|
||||
grouped_recordings[camera],
|
||||
)
|
||||
)
|
||||
|
||||
@ -193,6 +193,7 @@
|
||||
"yue": "粵語 (Cantonese)",
|
||||
"th": "ไทย (Thai)",
|
||||
"ca": "Català (Catalan)",
|
||||
"hr": "Hrvatski (Croatian)",
|
||||
"sr": "Српски (Serbian)",
|
||||
"sl": "Slovenščina (Slovenian)",
|
||||
"lt": "Lietuvių (Lithuanian)",
|
||||
|
||||
@ -37,6 +37,7 @@ const localeMap: Record<string, () => Promise<Locale>> = {
|
||||
lt: () => import("date-fns/locale/lt").then((module) => module.lt),
|
||||
th: () => import("date-fns/locale/th").then((module) => module.th),
|
||||
ca: () => import("date-fns/locale/ca").then((module) => module.ca),
|
||||
hr: () => import("date-fns/locale/hr").then((module) => module.hr),
|
||||
};
|
||||
|
||||
export function useDateLocale(): Locale {
|
||||
|
||||
@ -17,9 +17,12 @@ export const supportedLanguageKeys = [
|
||||
"vi",
|
||||
"th",
|
||||
"he",
|
||||
"fa",
|
||||
"ru",
|
||||
"tr",
|
||||
"pl",
|
||||
"hr",
|
||||
"sk",
|
||||
"lt",
|
||||
"uk",
|
||||
"cs",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user