new buffer paradigm

This commit is contained in:
Siwat Sirichai 2025-11-11 02:02:12 +07:00
parent fdaeb9981c
commit a519dea130
6 changed files with 341 additions and 327 deletions

View file

@ -25,14 +25,14 @@ class TensorRTModelController(BaseModelController):
model_repository,
model_id: str,
batch_size: int = 16,
force_timeout: float = 0.05,
max_queue_size: int = 100,
preprocess_fn: Optional[Callable] = None,
postprocess_fn: Optional[Callable] = None,
):
super().__init__(
model_id=model_id,
batch_size=batch_size,
force_timeout=force_timeout,
max_queue_size=max_queue_size,
preprocess_fn=preprocess_fn,
postprocess_fn=postprocess_fn,
)
@ -115,6 +115,7 @@ class TensorRTModelController(BaseModelController):
"stream_id": batch_frame.stream_id,
"timestamp": batch_frame.timestamp,
"detections": detections,
"frame": batch_frame.frame, # Include original frame tensor
"metadata": batch_frame.metadata,
}
results.append(result)
@ -175,6 +176,7 @@ class TensorRTModelController(BaseModelController):
"stream_id": batch_frame.stream_id,
"timestamp": batch_frame.timestamp,
"detections": detections,
"frame": batch_frame.frame, # Include original frame tensor
"metadata": batch_frame.metadata,
}
results.append(result)