mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-12-06 13:34:13 +03:00
Merge 7d5317959d into 9d4aac2b8e
This commit is contained in:
commit
acdd09199d
@ -22,6 +22,7 @@ from frigate.util.services import (
|
|||||||
get_bandwidth_stats,
|
get_bandwidth_stats,
|
||||||
get_cpu_stats,
|
get_cpu_stats,
|
||||||
get_fs_type,
|
get_fs_type,
|
||||||
|
get_hailo_temps,
|
||||||
get_intel_gpu_stats,
|
get_intel_gpu_stats,
|
||||||
get_jetson_stats,
|
get_jetson_stats,
|
||||||
get_nvidia_gpu_stats,
|
get_nvidia_gpu_stats,
|
||||||
@ -91,6 +92,9 @@ def get_temperatures() -> dict[str, float]:
|
|||||||
if temp is not None:
|
if temp is not None:
|
||||||
temps[apex] = temp
|
temps[apex] = temp
|
||||||
|
|
||||||
|
# Get temperatures for Hailo devices
|
||||||
|
temps.update(get_hailo_temps())
|
||||||
|
|
||||||
return temps
|
return temps
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -18,6 +18,7 @@ import cv2
|
|||||||
import psutil
|
import psutil
|
||||||
import py3nvml.py3nvml as nvml
|
import py3nvml.py3nvml as nvml
|
||||||
import requests
|
import requests
|
||||||
|
from hailo_platform import Device
|
||||||
|
|
||||||
from frigate.const import (
|
from frigate.const import (
|
||||||
DRIVER_AMD,
|
DRIVER_AMD,
|
||||||
@ -549,6 +550,48 @@ def get_jetson_stats() -> Optional[dict[int, dict]]:
|
|||||||
return results
|
return results
|
||||||
|
|
||||||
|
|
||||||
|
def get_hailo_temps() -> dict[str, float]:
|
||||||
|
"""Get temperatures for Hailo devices."""
|
||||||
|
temps = {}
|
||||||
|
|
||||||
|
try:
|
||||||
|
device_ids = Device.scan()
|
||||||
|
for i, device_id in enumerate(device_ids):
|
||||||
|
try:
|
||||||
|
with Device(device_id) as device:
|
||||||
|
temp_info = device.control.get_chip_temperature()
|
||||||
|
|
||||||
|
# Get board name and normalise it
|
||||||
|
identity = device.control.identify()
|
||||||
|
board_name = None
|
||||||
|
for line in str(identity).split("\n"):
|
||||||
|
if line.startswith("Board Name:"):
|
||||||
|
board_name = (
|
||||||
|
line.split(":", 1)[1].strip().lower().replace("-", "")
|
||||||
|
)
|
||||||
|
break
|
||||||
|
|
||||||
|
if not board_name:
|
||||||
|
board_name = f"hailo{i}"
|
||||||
|
|
||||||
|
# Use indexed name if multiple devices, otherwise just the board name
|
||||||
|
device_name = (
|
||||||
|
f"{board_name}-{i}" if len(device_ids) > 1 else board_name
|
||||||
|
)
|
||||||
|
|
||||||
|
# ts1_temperature is also available, but appeared to be the same as ts0 in testing.
|
||||||
|
temps[device_name] = round(temp_info.ts0_temperature, 1)
|
||||||
|
except Exception as e:
|
||||||
|
logger.debug(
|
||||||
|
f"Failed to get temperature for Hailo device {device_id}: {e}"
|
||||||
|
)
|
||||||
|
continue
|
||||||
|
except Exception as e:
|
||||||
|
logger.debug(f"Failed to scan for Hailo devices: {e}")
|
||||||
|
|
||||||
|
return temps
|
||||||
|
|
||||||
|
|
||||||
def ffprobe_stream(ffmpeg, path: str, detailed: bool = False) -> sp.CompletedProcess:
|
def ffprobe_stream(ffmpeg, path: str, detailed: bool = False) -> sp.CompletedProcess:
|
||||||
"""Run ffprobe on stream."""
|
"""Run ffprobe on stream."""
|
||||||
clean_path = escape_special_characters(path)
|
clean_path = escape_special_characters(path)
|
||||||
|
|||||||
@ -144,7 +144,7 @@ export default function GeneralMetrics({
|
|||||||
}
|
}
|
||||||
|
|
||||||
Object.entries(stats.detectors).forEach(([key], cIdx) => {
|
Object.entries(stats.detectors).forEach(([key], cIdx) => {
|
||||||
if (!key.includes("coral")) {
|
if (!key.includes("coral") && !key.includes("hailo")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user