Skip to content

Instantly share code, notes, and snippets.

@mrtj
Last active May 4, 2021 21:41
Show Gist options
  • Save mrtj/5567cd0077e0ee8e52ffd815a5e365b1 to your computer and use it in GitHub Desktop.
Save mrtj/5567cd0077e0ee8e52ffd815a5e365b1 to your computer and use it in GitHub Desktop.
Create Augmented Manifest Image Format for dogs-vs-cats dataset in a local folder
import glob
prefix = 's3://my_bucket/dogs_vs_cats/'
with open('manifest.jsonl', 'w') as f:
for img in glob.glob('*.jpg'):
lbl = 0 if img.startswith('dog') else 1
f.write('{{"source-ref":"{}{}", "class":"{}"}}\n'\
.format(prefix, img, lbl))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment