MCPcopy Create free account
hub / github.com/Topdu/OpenOCR / list_image_paths

Function list_image_paths

demo_gradio.py:91–104  ·  view source on GitHub ↗
(directory)

Source from the content-addressed store, hash-verified

89
90
91def list_image_paths(directory):
92 image_extensions = ('.png', '.jpg', '.jpeg', '.gif', '.bmp', '.tiff')
93
94 image_paths = []
95
96 for root, dirs, files in os.walk(directory):
97 for file in files:
98 if file.lower().endswith(image_extensions):
99 relative_path = os.path.relpath(os.path.join(root, file),
100 directory)
101 full_path = os.path.join(directory, relative_path)
102 image_paths.append(full_path)
103 image_paths = sorted(image_paths)
104 return image_paths
105
106
107def find_file_in_current_dir_and_subdirs(file_name):

Callers 1

demo_gradio.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected