Skip to content

Instantly share code, notes, and snippets.

@icebeam7
Created October 21, 2021 18:32
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save icebeam7/99382d4dca701919146b45fc378c8061 to your computer and use it in GitHub Desktop.
image_list = []
directories = os.listdir(training_images)
for tagName in directories:
tag = trainer.create_tag(project.id, tagName)
images = os.listdir(os.path.join(training_images,tagName))
for img in images:
with open(os.path.join(training_images,tagName,img), "rb") as image_contents:
image_list.append(ImageFileCreateEntry(name=img, contents=image_contents.read(), tag_ids=[tag.id]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment