From c59733d3266f7dc872a545d2fa857d0bbaa8dd86 Mon Sep 17 00:00:00 2001 From: Colin Wong Date: Fri, 1 Jul 2022 13:55:09 -0500 Subject: [PATCH] Expose OpenVINO batch_size similarly to TensorRT --- models/common.py | 1 + 1 file changed, 1 insertion(+) diff --git a/models/common.py b/models/common.py index a6488dd85648..a40207fd4d7b 100644 --- a/models/common.py +++ b/models/common.py @@ -366,6 +366,7 @@ def __init__(self, weights='yolov5s.pt', device=torch.device('cpu'), dnn=False, if not Path(w).is_file(): # if not *.xml w = next(Path(w).glob('*.xml')) # get *.xml file from *_openvino_model dir network = ie.read_model(model=w, weights=Path(w).with_suffix('.bin')) + batch_size = network.batch_size executable_network = ie.compile_model(network, device_name="CPU") # device_name="MYRIAD" for Intel NCS2 output_layer = next(iter(executable_network.outputs)) meta = Path(w).with_suffix('.yaml')