Fix file_name in save_crop (#17499)

Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Daniel Calvo 2024-11-13 20:17:49 +01:00 committed by GitHub
parent 496e6a3b86
commit ba41def4f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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,
)