wrapper
orchard.core.metadata.wrapper
¶
Pydantic Wrappers for Multi-Domain Dataset Registries.
Type-safe, validated access to dataset domains organized by task type (classification, detection) and resolution. Each wrapper subclass merges its own domain registries while avoiding global metadata overwrites.
Use get_registry(resolution, task_type) to obtain the correct wrapper.
DatasetRegistryWrapper
¶
Bases: BaseModel
Base wrapper for dataset registries.
Provides resolution validation, deep-copied access, and the
get_dataset lookup method. Subclasses define which domain
registries are available.
Attributes:
| Name | Type | Description |
|---|---|---|
resolution |
int
|
Target dataset resolution. |
registry |
dict[str, DatasetMetadata]
|
Deep-copied metadata registry for the selected resolution. |
get_dataset(name)
¶
Retrieve a DatasetMetadata entry by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Dataset identifier. |
required |
Returns:
| Type | Description |
|---|---|
DatasetMetadata
|
Deep copy of the matching DatasetMetadata. |
Raises:
| Type | Description |
|---|---|
KeyError
|
If dataset not found in registry. |
Source code in orchard/core/metadata/wrapper.py
ClassificationRegistryWrapper
¶
Bases: DatasetRegistryWrapper
Registry wrapper for classification datasets (medical, space, benchmark).
DetectionRegistryWrapper
¶
get_registry(resolution, task_type='classification')
¶
Factory function to obtain the correct registry wrapper for a task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
resolution
|
int
|
Target image resolution. |
required |
task_type
|
str
|
|
'classification'
|
Returns:
| Type | Description |
|---|---|
DatasetRegistryWrapper
|
Registry wrapper with datasets available for the given task and resolution. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |