From 00558a04ffbe8a831971ab6e6ca817ebce870451 Mon Sep 17 00:00:00 2001 From: knoppmyth <107227128+knoppmyth@users.noreply.github.com> Date: Fri, 7 Jun 2024 14:24:03 -0700 Subject: [PATCH] Update export_openvino.py Updated for OpenVino 2014.1.0. --- deploy/OpenVINO/export_openvino.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/deploy/OpenVINO/export_openvino.py b/deploy/OpenVINO/export_openvino.py index 2aaa7026..48d8a87f 100644 --- a/deploy/OpenVINO/export_openvino.py +++ b/deploy/OpenVINO/export_openvino.py @@ -83,8 +83,12 @@ try: LOGGER.info('\nStarting to export OpenVINO...') import_file = args.weights.replace('.pt', '.onnx') - export_dir = str(import_file).replace('.onnx', '_openvino') - cmd = f"mo --input_model {import_file} --output_dir {export_dir} --data_type {'FP16' if args.half else 'FP32'}" + if args.half: + export_dir = str(import_file).replace('.onnx', '_openvino') + cmd = f"mo --input_model {import_file} --output_dir {export_dir}" + else: + export_dir = str(import_file).replace('.onnx', '_openvino_fp16') + cmd = f"mo --input_model {import_file} --output_dir {export_dir} --compress_to_fp16" subprocess.check_output(cmd.split()) LOGGER.info(f'OpenVINO export success, saved as {export_dir}') except Exception as e: