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

@ -43,8 +43,8 @@ async def example_callback_pattern():
poll_interval=0.01, # 100 FPS
)
# Initialize with YOLOv8 model
model_path = "models/yolov8n.trt" # Adjust path as needed
# Initialize with YOLOv8 model (transparent loading: .pt, .engine, or .trt)
model_path = "models/yolov8n.trt" # Can also use .pt or .engine
if not os.path.exists(model_path):
logger.error(f"Model file not found: {model_path}")
return
@ -53,7 +53,8 @@ async def example_callback_pattern():
model_path=model_path,
model_id="yolo",
preprocess_fn=YOLOv8Utils.preprocess,
postprocess_fn=YOLOv8Utils.postprocess,
postprocess_fn=YOLOv8Utils.postprocess
# Note: No manual parameters needed for YOLO models
)
# Define callback for tracking results