# path

Python API: `luxonis_ml.utils.path`

## 函数

### parse_manifest_path

```python
def parse_manifest_path(value: PathType) -> Path:
```

从当前操作系统的数据集清单中解析路径字符串。

> **示例**
> ```pycon
>>> parse_manifest_path("images/cat.jpg").as_posix()
'images/cat.jpg'
>>> parse_manifest_path(r"images\\cat.jpg").as_posix()
'images/cat.jpg'
```

参数

 * `value` (`PathType`): 从清单中读取的路径值。

返回

 * `Path`: 解析后的路径。相对 Windows 路径在构建当前平台的 `Path` 之前会转换为 POSIX 风格的组件。

### path_to_posix

```python
def path_to_posix(value: PathType) -> str:
```

使用正斜杠序列化路径，以便于可移植清单。

> **示例**
> ```pycon
>>> path_to_posix(Path("images") / "cat.jpg")
'images/cat.jpg'
>>> path_to_posix(r"images\\cat.jpg")
'images/cat.jpg'
```

参数

 * `value` (`PathType`): 要序列化的路径值。

返回

 * `str`: POSIX 风格的路径字符串。

### resolve_manifest_path

```python
def resolve_manifest_path(base_dir: Path, value: PathType) -> Path:
```

解析相对于包含它的目录的清单路径。

参数

 * `base_dir` (`Path`): 相对路径解析的目录。
 * `value` (`PathType`): 从清单中读取的路径值。

返回

 * `Path`: 绝对解析路径。
