Compare commits

...

5 Commits

Author SHA1 Message Date
Josh Hawkins
6e79ec1624
Move another username to i18n key (#17820)
Same as https://github.com/blakeblackshear/frigate/pull/17818 - this time in the delete user dialog
2025-04-19 20:53:23 -05:00
Nicolas Mowen
43a9641ae8
Fix hailo detection (#17819) 2025-04-19 20:32:14 -05:00
Josh Hawkins
484ea10037
move username to i18n key (#17818)
Some languages structure phrases and sentences differently, so the username can't always be assumed to be the last item in the phrase. This change uses the Trans component to maintain the HTML formatting.
2025-04-19 19:05:49 -06:00
Nikola Kotur
9a786a50d6
Link fixed in restream docs (#17814) 2025-04-19 16:49:52 -05:00
Nicolas Mowen
38ffe21b69
Add support for rockchip GPU stats (#17812)
* Set rockchip GPU name

* Add support for calculating rockchip GPU load

* Format consistently

* Fix access error
2025-04-19 16:34:05 -05:00
9 changed files with 58 additions and 13 deletions

View File

@ -152,7 +152,7 @@ go2rtc:
my_camera: rtsp://username:$%40foo%25@192.168.1.100 my_camera: rtsp://username:$%40foo%25@192.168.1.100
``` ```
See [this comment(https://github.com/AlexxIT/go2rtc/issues/1217#issuecomment-2242296489) for more information. See [this comment](https://github.com/AlexxIT/go2rtc/issues/1217#issuecomment-2242296489) for more information.
## Advanced Restream Configurations ## Advanced Restream Configurations

View File

@ -175,6 +175,7 @@ class HailoAsyncInference:
return self.hef.get_input_vstream_infos()[0].shape return self.hef.get_input_vstream_infos()[0].shape
def run(self) -> None: def run(self) -> None:
job = None
with self.infer_model.configure() as configured_infer_model: with self.infer_model.configure() as configured_infer_model:
while True: while True:
batch_data = self.input_store.get() batch_data = self.input_store.get()
@ -202,7 +203,9 @@ class HailoAsyncInference:
bindings_list=bindings_list, bindings_list=bindings_list,
), ),
) )
job.wait(100)
if job is not None:
job.wait(100)
# ----------------- HailoDetector Class ----------------- # # ----------------- HailoDetector Class ----------------- #

View File

@ -28,12 +28,12 @@ class RequestStore:
def put(self, tensor_input: ndarray) -> int: def put(self, tensor_input: ndarray) -> int:
request_id = self.__get_request_id() request_id = self.__get_request_id()
self.input_queue.get((request_id, tensor_input)) self.input_queue.put((request_id, tensor_input))
return request_id return request_id
def get(self) -> tuple[int, ndarray] | None: def get(self) -> tuple[int, ndarray] | None:
try: try:
return self.input_queue.get_nowait() return self.input_queue.get()
except Exception: except Exception:
return None return None

View File

@ -24,6 +24,7 @@ from frigate.util.services import (
get_intel_gpu_stats, get_intel_gpu_stats,
get_jetson_stats, get_jetson_stats,
get_nvidia_gpu_stats, get_nvidia_gpu_stats,
get_rockchip_gpu_stats,
get_rockchip_npu_stats, get_rockchip_npu_stats,
is_vaapi_amd_driver, is_vaapi_amd_driver,
) )
@ -232,6 +233,11 @@ async def set_gpu_stats(
else: else:
stats["intel-vaapi"] = {"gpu": "", "mem": ""} stats["intel-vaapi"] = {"gpu": "", "mem": ""}
hwaccel_errors.append(args) hwaccel_errors.append(args)
elif "preset-rk" in args:
rga_usage = get_rockchip_gpu_stats()
if rga_usage:
stats["rockchip"] = rga_usage
elif "v4l2m2m" in args or "rpi" in args: elif "v4l2m2m" in args or "rpi" in args:
# RPi v4l2m2m is currently not able to get usage stats # RPi v4l2m2m is currently not able to get usage stats
stats["rpi-v4l2m2m"] = {"gpu": "", "mem": ""} stats["rpi-v4l2m2m"] = {"gpu": "", "mem": ""}

View File

@ -382,8 +382,29 @@ def get_intel_gpu_stats(sriov: bool) -> dict[str, str]:
return results return results
def get_rockchip_gpu_stats() -> dict[str, str]:
"""Get GPU stats using rk."""
try:
with open("/sys/kernel/debug/rkrga/load", "r") as f:
content = f.read()
except FileNotFoundError:
return None
load_values = []
for line in content.splitlines():
match = re.search(r"load = (\d+)%", line)
if match:
load_values.append(int(match.group(1)))
if not load_values:
return None
average_load = f"{round(sum(load_values) / len(load_values), 2)}%"
return {"gpu": average_load, "mem": "-"}
def get_rockchip_npu_stats() -> dict[str, str]: def get_rockchip_npu_stats() -> dict[str, str]:
"""Get stats using rk.""" """Get NPU stats using rk."""
try: try:
with open("/sys/kernel/debug/rknpu/load", "r") as f: with open("/sys/kernel/debug/rknpu/load", "r") as f:
npu_output = f.read() npu_output = f.read()

View File

@ -474,7 +474,7 @@
"deleteUser": { "deleteUser": {
"title": "Delete User", "title": "Delete User",
"desc": "This action cannot be undone. This will permanently delete the user account and remove all associated data.", "desc": "This action cannot be undone. This will permanently delete the user account and remove all associated data.",
"warn": "Are you sure you want to delete" "warn": "Are you sure you want to delete <strong>{{username}}</strong>?"
}, },
"passwordSetting": { "passwordSetting": {
"updatePassword": "Update Password for {{username}}", "updatePassword": "Update Password for {{username}}",
@ -483,7 +483,7 @@
}, },
"changeRole": { "changeRole": {
"title": "Change User Role", "title": "Change User Role",
"desc": "Update permissions for", "desc": "Update permissions for <strong>{{username}}</strong>",
"roleInfo": { "roleInfo": {
"intro": "Select the appropriate role for this user:", "intro": "Select the appropriate role for this user:",
"admin": "Admin", "admin": "Admin",

View File

@ -101,6 +101,9 @@ export default function Statusbar() {
case "intel-qsv": case "intel-qsv":
gpuTitle = "Intel GPU"; gpuTitle = "Intel GPU";
break; break;
case "rockchip":
gpuTitle = "Rockchip GPU";
break;
default: default:
gpuTitle = name; gpuTitle = name;
break; break;

View File

@ -1,4 +1,4 @@
import { useTranslation } from "react-i18next"; import { Trans, useTranslation } from "react-i18next";
import { Button } from "../ui/button"; import { Button } from "../ui/button";
import { import {
Dialog, Dialog,
@ -35,8 +35,14 @@ export default function DeleteUserDialog({
<div className="my-4 rounded-md border border-destructive/20 bg-destructive/5 p-4 text-center text-sm"> <div className="my-4 rounded-md border border-destructive/20 bg-destructive/5 p-4 text-center text-sm">
<p className="font-medium text-destructive"> <p className="font-medium text-destructive">
{t("users.dialog.deleteUser.warn")} <Trans
<span className="font-medium"> {username}</span>? i18nKey="users.dialog.deleteUser.warn"
ns="views/settings"
values={{ username }}
components={{
strong: <span className="font-medium" />,
}}
/>
</p> </p>
</div> </div>

View File

@ -1,4 +1,4 @@
import { useTranslation } from "react-i18next"; import { Trans, useTranslation } from "react-i18next";
import { Button } from "../ui/button"; import { Button } from "../ui/button";
import { import {
Dialog, Dialog,
@ -46,8 +46,14 @@ export default function RoleChangeDialog({
{t("users.dialog.changeRole.title")} {t("users.dialog.changeRole.title")}
</DialogTitle> </DialogTitle>
<DialogDescription> <DialogDescription>
{t("users.dialog.changeRole.desc")} <Trans
<span className="font-medium"> {username}</span> i18nKey="users.dialog.changeRole.desc"
ns="views/settings"
values={{ username }}
components={{
strong: <span className="font-medium" />,
}}
/>
</DialogDescription> </DialogDescription>
</DialogHeader> </DialogHeader>