Guest User

Untitled

a guest
Apr 21st, 2018
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. import glob
  2. import os
  3. from collections import namedtuple
  4. Tag = namedtuple('Tag', ['name', 'path', 'features'])
  5.  
  6. tag_images_folder = 'images/tags'
  7. tag_images = list(glob.iglob(os.path.join(tag_images_folder, '*.*')))
  8.  
  9. tags = []
  10. for img_path in tag_images:
  11. name = os.path.splitext(os.path.basename(img_path))[0]
  12. features = compute_features(img_path)
  13. tag = Tag(name=name, path=img_path, features=features)
  14. tags.append(tag)
Add Comment
Please, Sign In to add comment