mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-07-26 13:47:03 +02:00
video['global'] can be empty resulting in a divide by zero (#16993)
* video['global'] can be empty resulting in a divide by zero * formatting :(
This commit is contained in:
parent
433da8ffce
commit
f81bab8895
@ -362,7 +362,7 @@ def get_intel_gpu_stats(sriov: bool) -> dict[str, str]:
|
||||
if video_frame is not None:
|
||||
video[key].append(float(video_frame))
|
||||
|
||||
if render["global"]:
|
||||
if render["global"] and video["global"]:
|
||||
results["gpu"] = (
|
||||
f"{round(((sum(render['global']) / len(render['global'])) + (sum(video['global']) / len(video['global']))) / 2, 2)}%"
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user