feat(oci): offer an Intel NPU or a Coral as Frigate's object detector

This commit is contained in:
MacRimi
2026-09-28 17:48:47 +02:00
parent adc42caae3
commit bf07f0a8a9
8 changed files with 200 additions and 4 deletions
+4 -1
View File
@@ -2154,7 +2154,10 @@ if [[ -z ${PROXMENUX_OCI_TRANSACTION:-} ]] && ! oci_quiet python3 "${SCRIPT_DIR}
--archive "$ARCHIVE_PATH" --digest "$DIGEST"; then
msg_warn "$(translate "Container installed, but without a verifiable record for future updates.")"
fi
COMPLETION_NOTES=$(jq -c '.proxmox.installer_profile.completion_notes // []' "$TEMPLATE_FILE")
# The template's notes, then those of this installation's choices, such as the
# detector configuration for a device the user attached.
COMPLETION_NOTES=$(jq -cs '(.[0].proxmox.installer_profile.completion_notes // [])
+ (.[1].completion_notes // [])' "$TEMPLATE_FILE" "$DEPLOYMENT_FILE")
RESULT=$(jq -cn \
--arg app_id "$APP_ID" \
--arg image "$IMAGE_REF" \
+2 -1
View File
@@ -15,8 +15,9 @@ def gpu_path(path):
def peripheral_path(path):
"""Coral, NPU (/dev/accel), USB and serial nodes, identified by their sysfs path."""
return isinstance(path, str) and re.fullmatch(
r'/dev/(apex_[0-9]+|ttyUSB[0-9]+|ttyACM[0-9]+|bus/usb/[0-9]{3}/[0-9]{3})', path) is not None
r'/dev/(apex_[0-9]+|accel/accel[0-9]+|ttyUSB[0-9]+|ttyACM[0-9]+|bus/usb/[0-9]{3}/[0-9]{3})', path) is not None
def system_path(path):
+2 -2
View File
@@ -64,7 +64,7 @@ def _device(key, value):
raise ValueError(f'{key}: {translate("Unsupported device options")}')
path = fields.get('path')
if not (gpu_devices.gpu_path(path) or gpu_devices.peripheral_path(path)):
raise ValueError(f'{key}: {translate("Only Intel/AMD DRM, Coral and USB nodes can be adopted automatically")}')
raise ValueError(f'{key}: {translate("Only Intel/AMD DRM, Coral, NPU and USB nodes can be adopted automatically")}')
snapshot = gpu_devices.snapshot(path)
mode = fields.get('mode', '0660')
if not re.fullmatch(r'0?[0-7]{3}', mode):
@@ -120,7 +120,7 @@ def propose(record, config):
else:
device = _device(key, current[key])
deployment.setdefault('devices', []).append(device)
kind = 'GPU' if gpu_devices.gpu_path(device['host_path']) else 'USB/Coral'
kind = 'GPU' if gpu_devices.gpu_path(device['host_path']) else 'USB/Coral/NPU'
details.append(f"{key}: {device['host_path']} ({kind})")
filtered = b'\n'.join(line for line in config.splitlines()
if not any(line.startswith(key.encode() + b': ') for key in new_keys)) + b'\n'