# source

Python API: `luxonis_ml.data.datasets.source`

## Classes

### LuxonisComponent

Media component within a source.

Most commonly, this represents one image sensor.

#### Attributes

##### image_type

Image kind. Only used for image media.

##### media_type

Media kind represented by the component.

##### name

Human-readable component name.

### LuxonisSource

Source definition for a dataset.

A source describes which components or media streams are included. For example, an
[OAK-D](https://docs.luxonis.com/projects/hardware/en/latest/pages/BW1098OAK/) source can contain `rgb`, `left`, `right`, `depth`
components.

#### Methods

##### merge_with

```python
def merge_with(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**
> ```pycon
>>> 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.

#### Attributes

##### components

Components grouped in the source.

##### main_component

Component name used as the primary visualization target.

##### name

Human-readable source name.
