class documentation

class LuxonisSource(BaseModelExtraForbid):

View In Hierarchy

Source definition for a dataset.

A source describes which components or media streams are included. For example, an OAK-D source can contain rgb, left, right, depth components.

Method merge_with Merge two sources together.
Instance Variable components Components grouped in the source.
Instance Variable main_component Component name used as the primary visualization target.
Instance Variable name Human-readable source name.
Class Method _validate_components Undocumented
def merge_with(self, other: LuxonisSource) -> LuxonisSource:

Merge two sources together.

name and main_component are taken from the first source. components are merged together, with the second source's components taking precedence in case of name conflicts.

Example

>>> source1 = LuxonisSource(
...     name="source1",
...     components={
...         "rgb": LuxonisComponent(name="rgb"),
...     },
...     main_component="rgb",
... )
>>> source2 = LuxonisSource(
...     name="source2",
...     components={
...         "depth": LuxonisComponent(name="depth"),
...     },
...     main_component="depth",
... )
>>> merged_source = source1.merge_with(source2)
>>> merged_source.name
'source1'
>>> merged_source.main_component
'rgb'
>>> sorted(merged_source.components.keys())
['depth', 'rgb']
Parameters
other:LuxonisSourceSource to merge with.
Returns
LuxonisSourceNew source containing components from both sources.
components: dict[str, LuxonisComponent] =

Components grouped in the source.

main_component: str =

Component name used as the primary visualization target.

name: str =

Human-readable source name.

@field_validator('components', mode='before')
@classmethod
def _validate_components(cls, components: Any) -> Any:

Undocumented