From 1591b8ef2eb6d9701be1eae889973fdd7e9c88d8 Mon Sep 17 00:00:00 2001 From: EvaBardou <bardou@teklia.com> Date: Wed, 25 Oct 2023 16:58:18 +0200 Subject: [PATCH] Remove Path.with_suffix() usage when saving the JSON prediction --- dan/ocr/predict/inference.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dan/ocr/predict/inference.py b/dan/ocr/predict/inference.py index e33d0ba2..0d67983a 100644 --- a/dan/ocr/predict/inference.py +++ b/dan/ocr/predict/inference.py @@ -413,7 +413,7 @@ def process_batch( ) result["attention_gif"] = gif_filename - json_filename = Path(output, image_path.stem).with_suffix(".json") + json_filename = Path(output, f"{image_path.stem}.json") logger.info(f"Saving JSON prediction in {json_filename}") json_filename.write_text(json.dumps(result, indent=2)) -- GitLab