Last active
May 4, 2021 21:41
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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