simet.providers.local_binary_provider¶
simet.providers.local_binary_provider ¶
LocalBinaryProvider ¶
LocalBinaryProvider(data_path)
Bases: Provider
Provider that builds a binary image dataset from a local folder tree.
Wraps :class:simet.datasets.BinaryFolderDataset to read images from
self.data_path with the expected structure (case-insensitive class dirs):
GOOD/ and BAD/. Applies the given project :class:Transform.
Notes
- Labels are assigned as: GOOD → 1, BAD → 0.
- File discovery is recursive under the class subfolders.
- If the path does not exist or contains no images, an exception is raised.
Example
provider = LocalBinaryProvider(data_path=Path("./data/my_run")) ds = provider.get_data(transform=SomeTransform()) len(ds) > 0 True
Source code in simet/providers/base/provider.py
46 47 | |
get_data ¶
get_data(transform)
Return a BinaryFolderDataset for self.data_path with transform.
Validates that self.data_path exists before constructing the dataset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
transform
|
Transform
|
Project transform wrapper; |
required |
Returns:
| Name | Type | Description |
|---|---|---|
VisionDataset |
VisionDataset
|
A dataset yielding |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If |
RuntimeError
|
If no images are found under GOOD/ and BAD/ (raised by
|
Source code in simet/providers/local_binary_provider.py
32 33 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 | |