Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data = []
- for c, category in enumerate(categories):
- images = [os.path.join(dp, f) for dp, dn, filenames
- in os.walk(category) for f in filenames
- if os.path.splitext(f)[1].lower() in ['.jpg','.png','.jpeg']]
- for img_path in images:
- img, x = get_image(img_path)
- data.append({'x':np.array(x[0]), 'y':c})
- # count the number of classes
- num_classes = len(categories)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement