modosaic.providers.adapters.local_folder¶
modosaic.providers.adapters.local_folder ¶
LocalFolderAdapter ¶
LocalFolderAdapter(root, recursive=True, extensions=None)
Bases: DatasetAdapter
Dataset adapter that streams images from a local folder.
Initialize the adapter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
root
|
str | Path
|
Folder containing image files. |
required |
recursive
|
bool
|
Whether to scan subdirectories. |
True
|
extensions
|
Sequence[str] | None
|
Optional accepted extensions. Values may be passed with or without a leading dot. |
None
|
Source code in modosaic/providers/adapters/local_folder.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | |
iter_samples ¶
iter_samples()
Yield image records in stable path order.
Returns:
| Type | Description |
|---|---|
Iterator[ImageRecord]
|
Iterator of local image records. |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If the configured root does not exist. |
Source code in modosaic/providers/adapters/local_folder.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | |