diff --git a/sahi/model.py b/sahi/model.py index 465d5c65..95338810 100644 --- a/sahi/model.py +++ b/sahi/model.py @@ -483,7 +483,7 @@ def _create_object_prediction_list_from_original_predictions( bbox = [x1, y1, x2, y2] score = prediction[4] category_id = int(prediction[5]) - category_name = original_predictions.names[category_id] + category_name = self.category_mapping[str(category_id)] # ignore invalid predictions if bbox[0] > bbox[2] or bbox[1] > bbox[3] or bbox[0] < 0 or bbox[1] < 0 or bbox[2] < 0 or bbox[3] < 0: