From 709b3fd3aaf08f598dec92191acd86f73335b38c Mon Sep 17 00:00:00 2001 From: Francesco Mattioli Date: Tue, 27 Aug 2024 14:54:38 +0200 Subject: [PATCH] updated mct inference --- ultralytics/nn/autobackend.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ultralytics/nn/autobackend.py b/ultralytics/nn/autobackend.py index cf540a12d..1ddc74c81 100644 --- a/ultralytics/nn/autobackend.py +++ b/ultralytics/nn/autobackend.py @@ -166,7 +166,7 @@ class AutoBackend(nn.Module): check_requirements("opencv-python>=4.5.4") net = cv2.dnn.readNetFromONNX(w) - # ONNX Runtime + # ONNX Runtime and MCT elif onnx: LOGGER.info(f"Loading {w} for ONNX Runtime inference...") check_requirements(("onnx", "onnxruntime-gpu" if cuda else "onnxruntime")) @@ -178,7 +178,7 @@ class AutoBackend(nn.Module): providers = ["CUDAExecutionProvider", "CPUExecutionProvider"] if cuda else ["CPUExecutionProvider"] if mct: import mct_quantizers as mctq - + from sony_custom_layers.pytorch.object_detection import nms_ort session = onnxruntime.InferenceSession( w, mctq.get_ort_session_options(), providers=["CPUExecutionProvider"] )