Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanwharris committed Jan 11, 2022
1 parent fc339ad commit ee29b04
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flash/image/instance_segmentation/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -350,7 +350,7 @@ def from_voc(
... f"<difficult>0</difficult><occluded>0</occluded><bndbox><xmin>{xmin}</xmin><xmax>{xmax}</xmax>"
... f"<ymin>{ymin}</ymin><ymax>{ymax}</ymax></bndbox></object></annotation>"
... )
... 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:
Expand Down

0 comments on commit ee29b04

Please sign in to comment.