From d545ab45fb551eaf74db9bce91aa408fee1cdc11 Mon Sep 17 00:00:00 2001 From: jaeminSon Date: Fri, 19 May 2023 13:45:31 +0900 Subject: [PATCH] [fix bug] convert a format of bounding_box from string to list of floats --- prepare_dataset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prepare_dataset.py b/prepare_dataset.py index d565d83..4fe0706 100644 --- a/prepare_dataset.py +++ b/prepare_dataset.py @@ -81,7 +81,7 @@ def main(annotations_path: Path, save_path: Path, no_split: bool, reduce: float) if (output_path / f'{ann_id}.png').exists(): continue - img_cropped = crop_minAreaRect(img, *info['bounding_box']) + img_cropped = crop_minAreaRect(img, *eval(info['bounding_box'])) cv2.imwrite(str(output_path / f'{ann_id}.png'), img_cropped) json.dump(words, (output_path / 'words.json').open('w'))