---
title: kognic-openlabel
slug: api-guide/ko/kognic-openlabel
docTags: 
createdAt: 2024-12-17T13:03:57.000Z
---

이 OpenLABEL json 스키마를 사용하여 어노테이션을 더 쉽게 다룰 수 있도록 [`kognic-openlabel`](https://pypi.org/project/kognic-openlabel)이라는 Python 패키지를 만들었습니다. 이 Python 패키지는 OpenLABEL 형식을 `pydantic` 모델로 표현하며, 다음과 같이 설치할 수 있습니다.

```bash
pip install --upgrade kognic-openlabel
```

`pydantic`을 사용하므로, 이 모델은 검증(validation) 기능과 직렬화/역직렬화 메서드를 함께 제공합니다. 아래는 서로 다른 형식 간에 손쉽게 변환하는 방법에 대한 예제입니다.

```python
openlabel_dict = {
    "openlabel": {
        "metadata": {
            "schema_version": "1.0.0"
        }
    }
}

from kognic.openlabel.models import OpenLabelAnnotation

# Deserialize dict
openlabel_annotation = OpenLabelAnnotation.model_validate(openlabel_dict)

# Serialize to json
openlabel_json = openlabel_annotation.model_dump_json(exclude_none=True)

# Deserialize json
openlabel_annotation = OpenLabelAnnotation.model_validate_json(openlabel_json)

# Serialize to dict
openlabel_dict = openlabel_annotation.model_dump(exclude_none=True)
```
