feat: TensorRT 固定 batch=4 重构

- tensorrt_engine.py 工业级 Buffer Pool
- preprocessor.py 添加 pad_to_batch4()
- postprocessor.py 支持批量输出
- settings.py 固定 batch_size=4
This commit is contained in:
2026-02-02 14:49:47 +08:00
parent 956bcbbc3e
commit 745cadc8e7
18 changed files with 68258 additions and 130 deletions

View File

@@ -204,7 +204,7 @@ class EdgeInferenceService:
frame: VideoFrame,
roi
):
"""处理ROI帧"""
"""处理ROI帧,固定 batch=4 推理"""
try:
if not roi.enabled:
return
@@ -213,7 +213,7 @@ class EdgeInferenceService:
processed_image, scale_info = cropped
batch_data = self._preprocessor._batch_preprocessor._stack_and_normalize(
batch_data, _ = self._preprocessor._batch_preprocessor.preprocess_batch(
[processed_image]
)