From 2aac80d980d568d784c4e27831b37368b1960d03 Mon Sep 17 00:00:00 2001 From: oleg-pereziabov Date: Sat, 28 Dec 2024 07:13:00 +0300 Subject: [PATCH] Fixed UTF-8 bug in `convert_coco` (#18412) --- ultralytics/data/converter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ultralytics/data/converter.py b/ultralytics/data/converter.py index e854c60d..751e19e5 100644 --- a/ultralytics/data/converter.py +++ b/ultralytics/data/converter.py @@ -266,7 +266,7 @@ def convert_coco( # since LVIS val set contains images from COCO 2017 train in addition to the COCO 2017 val split. (fn / "train2017").mkdir(parents=True, exist_ok=True) (fn / "val2017").mkdir(parents=True, exist_ok=True) - with open(json_file) as f: + with open(json_file, encoding="utf-8") as f: data = json.load(f) # Create image dict