Created
March 30, 2013 10:44
-
-
Save seaslee/5276281 to your computer and use it in GitHub Desktop.
walk the two level files like following:
====dir ||subdir ||files ||subdir ||files ...
This file contains 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
def imgs(imgsdir): | |
for dirname, subdirnames, subfiles in os.walk(imgsdir): | |
#subdir for each query of images | |
for subdir in subdirnames: | |
for dirname1, subdirnames1, subfiles1 in os.walk(os.path.join(dirname, subdir)): | |
#each image in the directory of one query | |
for img in subfiles1: | |
imgpath = os.path.join(dirname1, img) | |
yield imgpath |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment