-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d277bb7
commit 543114f
Showing
3 changed files
with
30 additions
and
4 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,33 @@ | ||
# author: Adrian Rosebrock | ||
# website: http://www.pyimagesearch.com | ||
# Updated by Tim Poulsen, @skypanther | ||
|
||
# USAGE | ||
# from the demos folder: | ||
# python image_paths.py | ||
|
||
# import the necessary packages | ||
from __future__ import print_function | ||
# You'll need to force '../imutils' into the system path if testing | ||
# before this addition is merged into the imutils library so that you | ||
# load the local package not the one installed on your system. | ||
# sys.path.insert(0, '../imutils') | ||
# import sys | ||
from imutils import paths | ||
|
||
# loop over the image paths in the previous 'demo_images' | ||
# directory and print the paths to the terminal | ||
for imagePath in paths.list_images("../demo_images"): | ||
print(imagePath) | ||
|
||
print('\nUsing `list_files` with a jpg file extension filter:\n') | ||
|
||
# validExts must be a tuple | ||
for imagePath in paths.list_files("../demo_images", validExts=('.jpg',)): | ||
print(imagePath) | ||
|
||
print('\nUsing `list_files` with a contains filter:\n') | ||
|
||
# validExts must be a tuple | ||
for imagePath in paths.list_files("../demo_images", contains='bridge'): | ||
print(imagePath) |
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