From 68e42d0b0d6d432254e441ade87c735788429fb6 Mon Sep 17 00:00:00 2001 From: Ashwin Vaidya Date: Thu, 9 Nov 2023 03:16:01 +0100 Subject: [PATCH] Add metadata to optimized model (#2618) * bug fix for legacy openvino models * Add metadata to optimized model * Revert formatting changes --------- Co-authored-by: Ashwin Vaidya --- src/otx/algorithms/anomaly/tasks/openvino.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/otx/algorithms/anomaly/tasks/openvino.py b/src/otx/algorithms/anomaly/tasks/openvino.py index f607a4a5d4e..a8dfa580e15 100644 --- a/src/otx/algorithms/anomaly/tasks/openvino.py +++ b/src/otx/algorithms/anomaly/tasks/openvino.py @@ -361,6 +361,8 @@ def optimize( output_model.optimization_type = ModelOptimizationType.POT output_model.optimization_methods = [OptimizationMethod.QUANTIZATION] output_model.precision = [ModelPrecision.INT8] + metadata = self.get_metadata() + output_model.set_data("metadata", json.dumps(metadata).encode()) self.task_environment.model = output_model self.inference_model = self.get_openvino_model()