Why not just try downloading all the files in the folder? If OpenCV can't open it, fine. Go to the next one. cv2.imread() returns None if the image cannot be opened. It is strange that this does not cause an exception.
import cv2 import os def load_images_from_folder(folder): images = [] for filename in os.listdir(folder): img = cv2.imread(os.path.join(folder,filename)) if img is not None: images.append(img) return images
source share