Skip to content

simet.parser.simple.provider

simet.parser.simple.provider

SimpleProviderParser

Minimal provider factory for a single local-unlabeled provider.

Converts a filesystem path into a :class:LocalProviderWithoutClass. Useful as a lightweight default when you only need to read images without labels (e.g., feature extraction or inference).

Notes
  • This parser intentionally supports only LocalProviderWithoutClass. For labeled data or other sources, implement a richer parser/factory that selects providers by type.

parse_provider staticmethod

parse_provider(provider_path)

Return a LocalProviderWithoutClass for the given path.

Parameters:

Name Type Description Default
provider_path str

Filesystem path to the image root directory.

required

Returns:

Name Type Description
Provider Provider

A LocalProviderWithoutClass instance rooted at provider_path.

Example

p = SimpleProviderParser.parse_provider("data/unlabeled") p.data_path.as_posix().endswith("data/unlabeled") True

Source code in simet/parser/simple/provider.py
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
@staticmethod
def parse_provider(provider_path: str) -> Provider:
    """Return a `LocalProviderWithoutClass` for the given path.

    Args:
        provider_path (str): Filesystem path to the image root directory.

    Returns:
        Provider: A `LocalProviderWithoutClass` instance rooted at `provider_path`.

    Example:
        >>> p = SimpleProviderParser.parse_provider("data/unlabeled")
        >>> p.data_path.as_posix().endswith("data/unlabeled")
        True
    """
    data_path = Path(provider_path)
    return LocalProviderWithoutClass(data_path)