This file contains hidden or 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
| import os | |
| #used for accessing the particular folders | |
| folders = ['Patient1', 'Patient2','Patient3'] | |
| #uncomment the following line to access all folders present in the directory | |
| #folders = os.listdir("C:\\Users\\niket\\Desktop\\Download Dustbin\\main_folder") | |
| def load_from_folder(folder): | |
| images = [] | |
| sub_path = "C:\\Users\\niket\\Desktop\\Download Dustbin\\main_folder\\" + folder | |
| for filename in os.listdir(sub_path): | |
| if any([filename.endswith(x) for x in ['.jpg', '.jpeg']]): |