find_images_in_folder
anomaly_match.data_io.find_images_in_folder
¶
Functions to retrieve image filenames from folders.
get_image_names_from_folder(folder_path, recursive=False, extensions=None)
¶
Get all image filenames from a folder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
folder_path
|
str
|
Path to the folder containing images |
required |
recursive
|
bool
|
Whether to search recursively in subfolders. Defaults to False. |
False
|
extensions
|
list[str] | None
|
List of file extensions to include. Defaults to SUPPORTED_IMAGE_EXTENSIONS if None. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
list |
list[str]
|
List of image filenames (relative to folder_path) |
Source code in anomaly_match/data_io/find_images_in_folder.py
get_image_paths_from_folder(folder_path, recursive=False, extensions=None)
¶
Get all image paths from a folder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
folder_path
|
str
|
Path to the folder containing images |
required |
recursive
|
bool
|
Whether to search recursively in subfolders. Defaults to False. |
False
|
extensions
|
list[str] | None
|
List of file extensions to include. Defaults to SUPPORTED_IMAGE_EXTENSIONS if None. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
list |
list[str]
|
List of absolute image paths |