fix: gpu memory leaks

This commit is contained in:
Siwat Sirichai 2025-11-10 22:10:46 +07:00
parent 3a47920186
commit 593611cdb7
13 changed files with 420 additions and 166 deletions

View file

@ -63,6 +63,10 @@ class YOLOv8Utils:
# Normalize to [0, 1] (YOLOv8 expects normalized input)
frame_normalized = frame_resized / 255.0
# NOTE: Don't track these tensors - they're short-lived inputs to TensorRT
# that get automatically freed by PyTorch after inference completes.
# Tracking them would show false "leaks" since we can't track when TensorRT consumes them.
return frame_normalized
@staticmethod