From ee29b04ef6cd964ff9ae1ba633b97efaa3ff1ec1 Mon Sep 17 00:00:00 2001 From: Ethan Harris Date: Tue, 11 Jan 2022 19:03:38 +0000 Subject: [PATCH] Updates --- flash/image/instance_segmentation/data.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flash/image/instance_segmentation/data.py b/flash/image/instance_segmentation/data.py index b883eb86d2..2dc5c798d9 100644 --- a/flash/image/instance_segmentation/data.py +++ b/flash/image/instance_segmentation/data.py @@ -330,7 +330,7 @@ def from_voc( >>> import numpy as np >>> from PIL import Image >>> rand_image = Image.fromarray(np.random.randint(0, 255, (64, 64, 3), dtype="uint8")) - >>> rand_mask= Image.fromarray(np.random.randint(0, 3, (64, 64), dtype="uint8")) + >>> rand_mask = Image.fromarray(np.random.randint(0, 3, (64, 64), dtype="uint8")) >>> os.makedirs("train_folder", exist_ok=True) >>> os.makedirs("train_masks", exist_ok=True) >>> os.makedirs("train_annotations", exist_ok=True) @@ -350,7 +350,7 @@ def from_voc( ... f"00{xmin}{xmax}" ... f"{ymin}{ymax}" ... ) - ... with open(os.path.join("train_annotations", f"image_{i}.xml"), "w") as file: + ... with open(os.path.join("train_annotations", f"image_{i + 1}.xml"), "w") as file: ... _ = file.write(annotation) The folder ``train_folder`` has the following contents: