Skip to content

Commit 830638e

Browse files
authored
fix yolov5 category names (#297)
1 parent 7a2bf29 commit 830638e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sahi/model.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ def _create_object_prediction_list_from_original_predictions(
483483
bbox = [x1, y1, x2, y2]
484484
score = prediction[4]
485485
category_id = int(prediction[5])
486-
category_name = original_predictions.names[category_id]
486+
category_name = self.category_mapping[str(category_id)]
487487

488488
# ignore invalid predictions
489489
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:

0 commit comments

Comments
 (0)