simet.providers.local_provider_no_class¶
simet.providers.local_provider_no_class ¶
LocalProviderWithoutClass ¶
LocalProviderWithoutClass(data_path)
Bases: Provider
Provider that exposes unlabeled images from a local folder tree.
Wraps :class:simet.datasets.NoClassImageDataset to read all images found
recursively under self.data_path and apply the given project
:class:Transform. Targets are a dummy 0 for every sample (no classes).
Notes
- Use when you only need images (e.g., feature extraction/inference) and labels are irrelevant.
- File discovery is recursive; supported extensions are defined by
:class:
NoClassImageDataset.
Example
provider = LocalProviderWithoutClass(data_path=Path("./data/unlabeled")) ds = provider.get_data(transform=SomeTransform()) x, y = ds[0] int(y) 0
Source code in simet/providers/base/provider.py
46 47 | |
get_data ¶
get_data(transform)
Return a NoClassImageDataset 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 |
Source code in simet/providers/local_provider_no_class.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 | |