kognic-openlabel
1 分
このopenlabel jsonスキーマを使用して、アノテーションの操作を容易にするpythonパッケージ kognic openlabel https //pypi org/project/kognic openlabel を作成しました。このパッケージはopenlabel形式を pydantic モデルとしてモデル化しており、以下の方法でインストールできます。 pip install upgrade kognic openlabel pydantic を使用しているため、モデルにはバリデーションとシリアライズ・デシリアライズのためのメソッドが含まれています。以下は、異なる形式間で簡単に変換する方法の例です。 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)
