Skip to content

Commit

Permalink
Expose OpenVINO batch_size similarly to TensorRT (#8437)
Browse files Browse the repository at this point in the history
  • Loading branch information
democat3457 committed Jul 1, 2022
1 parent d94b470 commit da2ee39
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions models/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit da2ee39

Please sign in to comment.