# solo_parser

Python API: `luxonis_ml.data.parsers.solo_parser`

## Classes

| Name | Description |
| --- | --- |
|
[`SOLOParser`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-ml/luxonis-ml-api-reference/data/parsers/solo_parser.md)
| Parse a directory with SOLO annotations into LDF. |

### class `SOLOParser`

```python
class SOLOParser(BaseParser)
```

Parse a directory with SOLO annotations into LDF.

Expected format:

```text
dataset_dir/
├── train/
│   ├── metadata.json
│   ├── sensor_definitions.json
│   ├── annotation_definitions.json
│   ├── metric_definitions.json
│   └── sequence.<SequenceNUM>/
│       ├── step<StepNUM>.camera.jpg
│       ├── step<StepNUM>.frame_data.json
│       └── (OPTIONAL: step<StepNUM>.camera.semantic segmentation.jpg)
├── valid/
└── test/
```

This is the default format returned by Unity simulation engine.

Methods

| Name | Description |
| --- | --- |
|
[`from_dir`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-ml/luxonis-ml-api-reference/data/parsers/solo_parser.md)
| Parse all SOLO data in a source dataset directory. |
|
[`from_split`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-ml/luxonis-ml-api-reference/data/parsers/solo_parser.md)
| Parse one SOLO split into LDF records. |
|
[`validate_split`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-ml/luxonis-ml-api-reference/data/parsers/solo_parser.md)
| Validate whether a split directory has the expected SOLO format. |

#### method `from_dir`

```python
def from_dir(dataset_dir: Path) -> tuple[list[Path], list[Path], list[Path]]
```

Parse all SOLO data in a source dataset directory.

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `dataset_dir` | `Path` | Source dataset directory. | required |

Returns

| Type | Description |
| --- | --- |
| `tuple[list[Path], list[Path], list[Path]]` | Added images for the train, validation, and test splits. |

#### method `from_split`

```python
def from_split(split_path: Path) -> ParserOutput
```

Parse one SOLO split into LDF records.

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `split_path` | `Path` | Directory with SOLO sequences and annotations. | required |

Returns

| Type | Description |
| --- | --- |
| `ParserOutput` | Parser output containing annotation records, skeleton metadata, and added images. |

Raises

| Type | Description |
| --- | --- |
| `FileNotFoundError` | If the split directory, annotation definitions file, referenced image, or referenced mask does not exist.
|
| `ValueError` | If no bounding-box class names can be identified from `annotation_definitions.json`. |

#### static method `validate_split`

```python
def validate_split(split_path: Path) -> dict[str, Any] | None
```

Validate whether a split directory has the expected SOLO format.

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `split_path` | `Path` | Path to a split directory. | required |

Returns

| Type | Description |
| --- | --- |
| `dict[str, Any] | None` | Keyword arguments for `from_split`, or `None` if the split is not in the expected format. |
