From 31e96e20d300348294c4a37044082607dce654c9 Mon Sep 17 00:00:00 2001 From: Mohammed Yasin <32206511+Y-T-G@users.noreply.github.com> Date: Mon, 10 Feb 2025 07:13:08 +0800 Subject: [PATCH] Return PIL image if `pil=True` (#19146) Signed-off-by: Mohammed Yasin <32206511+Y-T-G@users.noreply.github.com> --- 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 cda3d852..b35f278a 100644 --- a/ultralytics/engine/results.py +++ b/ultralytics/engine/results.py @@ -583,7 +583,7 @@ class Results(SimpleClass): if save: annotator.save(filename) - return annotator.result() + return annotator.im if pil else annotator.result() def show(self, *args, **kwargs): """