Expose OpenVINO `batch_size` similarly to TensorRT (#8437)

pull/8441/head
Colin Wong 2022-07-01 15:15:09 -05:00 committed by GitHub
parent d94b4705a6
commit da2ee3934e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -366,6 +366,7 @@ class DetectMultiBackend(nn.Module):
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')