Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python get all images in directory

import glob

for filename in glob.iglob(root_dir + '**/*.jpg', recursive=True):
    # Do something
Comment

get all type of image in folder python

import cv2
import glob

imdir = 'path/to/files/'
ext = ['png', 'jpg', 'gif']    # Add image formats here

files = []
[files.extend(glob.glob(imdir + '*.' + e)) for e in ext]

images = [cv2.imread(file) for file in files]
Comment

PREVIOUS NEXT
Code Example
Python :: pygame font 
Python :: linux python install 
Python :: filter dataframe by index 
Python :: stop a subprocess python 
Python :: write set to txt python 
Python :: calculate market value crsp pandas 
Python :: python matplotlib inline 
Python :: get channel from id discord.py 
Python :: python loop every month datetime 
Python :: pandas lambda if else 
Python :: how to add row to the Dataframe in python 
Python :: python drop rows with two conditions 
Python :: django annotate concat string 
Python :: python convert 1 to 01 
Python :: shutil.make_archive 
Python :: background image in python 
Python :: python push into array if not exists 
Python :: python write a list to a file line by line 
Python :: dump data in json file and keep structure tabulation 
Python :: runner up score hackerrank 
Python :: colorized progress bar python in console 
Python :: flask download a file 
Python :: how to loop through files in a directory python 
Python :: pyinstaller for spacy code 
Python :: how to get more than one word in a list in python 
Python :: neural network without training return same output with random biases 
Python :: python to exe 
Python :: How to decrease length of entry in tkinter 
Python :: run py file in another py file 
Python :: how to access a private attribute in child class python 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =