class documentation
class LuxonisSource(BaseModelExtraForbid):
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 |
Merge two sources together. |
| Instance Variable | components |
Components grouped in the source. |
| Instance Variable | main |
Component name used as the primary visualization target. |
| Instance Variable | name |
Human-readable source name. |
| Class Method | _validate |
Undocumented |
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:LuxonisSource | Source to merge with. |
| Returns | |
LuxonisSource | New source containing components from both sources. |
@field_validator( 'components', mode='before')
@classmethod
def _validate_components(cls, components: @classmethod
Any) -> Any:
¶
Undocumented