From ba41def4f995d740bba0e12a9f7b7e1a0816b398 Mon Sep 17 00:00:00 2001 From: Daniel Calvo <124576235+M3nxudo@users.noreply.github.com> Date: Wed, 13 Nov 2024 20:17:49 +0100 Subject: [PATCH] Fix `file_name` in `save_crop` (#17499) Co-authored-by: UltralyticsAssistant Co-authored-by: Glenn Jocher --- ultralytics/engine/results.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ultralytics/engine/results.py b/ultralytics/engine/results.py index 029e4471e0..8de0a2e6a1 100644 --- a/ultralytics/engine/results.py +++ b/ultralytics/engine/results.py @@ -750,7 +750,7 @@ class Results(SimpleClass): save_one_box( d.xyxy, self.orig_img.copy(), - file=Path(save_dir) / self.names[int(d.cls)] / f"{Path(file_name)}.jpg", + file=Path(save_dir) / self.names[int(d.cls)] / Path(file_name).with_suffix(".jpg"), BGR=True, )