Fixed UTF-8 bug in convert_coco (#18412)

This commit is contained in:
oleg-pereziabov 2024-12-28 07:13:00 +03:00 committed by GitHub
parent cf9ab17426
commit 2aac80d980
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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