From 57d0c54e46ac58b3d84f42d2e2990c3abc94e0c9 Mon Sep 17 00:00:00 2001 From: Eugene Liu Date: Mon, 14 Nov 2022 11:39:30 +0000 Subject: [PATCH] Fix OV Inference issues (tiling tests & detection tests) (#1361) * update submodule * add shape check Co-authored-by: harimkan --- .../detection_tasks/apis/detection/openvino_task.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/external/mmdetection/detection_tasks/apis/detection/openvino_task.py b/external/mmdetection/detection_tasks/apis/detection/openvino_task.py index bfec4d86650..8a2d7cb7533 100644 --- a/external/mmdetection/detection_tasks/apis/detection/openvino_task.py +++ b/external/mmdetection/detection_tasks/apis/detection/openvino_task.py @@ -149,7 +149,8 @@ def post_process(self, prediction: Dict[str, np.ndarray], metadata: Dict[str, An detections = np.array(detections) if isinstance(self.converter, MaskToAnnotationConverter): return self.converter.convert_to_annotation(detections, metadata) - detections[:, 2:] /= np.tile(metadata["original_shape"][1::-1], 2) + if len(detections): + detections[:, 2:] /= np.tile(metadata["original_shape"][1::-1], 2) return self.converter.convert_to_annotation(detections) @check_input_parameters_type()