Skip to main content

Kognic OpenLABEL Datamodel

Project description

Kognic OpenLABEL

Installation

Install the Kognic OpenLABEL package from pip with

pip install kognic-openlabel

Serialization and deserialization

Since all models inherit from pydantic's BaseModel, serialization and deserialization from dicts or json strings are relatively straight forward.

data = {
    "openlabel": {
        "metadata": {
            "schema_version": "1.0.0"
        }
    }
}

import kognic.openlabel.models as OLM

# Deserialize dict
openlabel_annotation = OLM.OpenLabelAnnotation.model_validate(data)

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

# Deserialize json
openlabel_annotation = OLM.OpenLabelAnnotation.model_validate_json(json_data)

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

Further reading

https://www.asam.net/project-detail/asam-openlabel-v100/

Changelog

[2.0.3] - 2024-07-26

  • Fix so that model_dump works correctly with ontologies

[2.0.2] - 2024-07-26

...

[2.0.1] - 2023-11-07

  • Use model_rebuild instead of deprecated update_forward_refs

[2.0.0] - 2023-11-06

  • Bump pydantic to >2

[1.0.1] - 2023-07-05

  • Pin pydantic version to <2

[1.0.0] - 2022-10-18

  • Annotell becomes Kognic

[0.1.4] - 2022-01-24

  • Improved serializability for enum classes

[0.1.3] - 2022-01-04

  • Fixed issues with version 0.1.2

[0.1.2] - 2021-12-29

  • Updated several fields with multiple types to fix issues with serialization and deserialization. For example, the coordinates on Poly2d objects were previously always parsed to strings. This update means that an attempt to parse them to floats is made. If this fails the they will be parsed to strings.

[0.1.1] - 2021-11-24

  • Updated stream properties model generation to be nicer to work with

[0.1.0] - 2021-11-18

  • Updated json schema and model to be true to the 1.0.0 release of openlabel. Previously it was based on the release-candidate

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kognic_openlabel-2.0.5.tar.gz (32.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kognic_openlabel-2.0.5-py3-none-any.whl (30.4 kB view details)

Uploaded Python 3

File details

Details for the file kognic_openlabel-2.0.5.tar.gz.

File metadata

  • Download URL: kognic_openlabel-2.0.5.tar.gz
  • Upload date:
  • Size: 32.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.1 CPython/3.11.11

File hashes

Hashes for kognic_openlabel-2.0.5.tar.gz
Algorithm Hash digest
SHA256 c48f44876753f5f7d83b141470a33077d7a3958019bcfef9642bafa5b63e56e7
MD5 6eadda64c875368cf7ec8a68dbff3037
BLAKE2b-256 ecb9fed0d4458c156936b9250aad4ad84663b1f89560797c0226292a1b8ebf57

See more details on using hashes here.

File details

Details for the file kognic_openlabel-2.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for kognic_openlabel-2.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 9e9757c9b2f06c31b2fc2e3f2760a0fcb9bdef74f18616ecf419175cca3931f9
MD5 446754bbe638cf2e877e187d77f0ccb0
BLAKE2b-256 60f238484acb40e77f48e924f7d3f824b12d3ac1995ff5edd414c9529961bf83

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page