From 382ac7ffc296151fc7fe10201b8fc66ada79cbcd Mon Sep 17 00:00:00 2001 From: idanb Date: Mon, 19 Aug 2024 23:28:47 +0300 Subject: [PATCH] Update format_results to get unnormalized coordinates bbox --- .../mct_model_garden/evaluation_metrics/coco_evaluation.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tutorials/mct_model_garden/evaluation_metrics/coco_evaluation.py b/tutorials/mct_model_garden/evaluation_metrics/coco_evaluation.py index 9bb90c0c0..2a6d1a869 100644 --- a/tutorials/mct_model_garden/evaluation_metrics/coco_evaluation.py +++ b/tutorials/mct_model_garden/evaluation_metrics/coco_evaluation.py @@ -139,6 +139,7 @@ def format_results(self, outputs: List, img_ids: List, orig_img_dims: List, outp detections = [] h_model, w_model = output_resize['shape'] preserve_aspect_ratio = output_resize['aspect_ratio_preservation'] + normalized_coords = output_resize.get('normalized_coords', True) if self.task == 'Detection': # Process model outputs and convert to detection format @@ -149,7 +150,7 @@ def format_results(self, outputs: List, img_ids: List, orig_img_dims: List, outp output[2].numpy())).squeeze() # Convert COCO 80-class indices to COCO 91-class indices boxes = output[0].numpy().squeeze() # Extract bounding boxes boxes = scale_boxes(boxes, orig_img_dims[idx][0], orig_img_dims[idx][1], h_model, w_model, - preserve_aspect_ratio) + preserve_aspect_ratio, normalized_coords) for score, label, box in zip(scores, labels, boxes): detection = {