diff --git a/CHANGELOG.md b/CHANGELOG.md index 19752679..02dfbb01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to the [Nucleus Python Client](https://github.com/scaleapi/n The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.8.2](https://github.com/scaleapi/nucleus-python-client/releases/tag/v0.8.2) - 2022-03-18 + +### Added +- a fix to the CameraModels enumeration to fix export of camera calibrations for 3D scenes + ## [0.8.1](https://github.com/scaleapi/nucleus-python-client/releases/tag/v0.8.0) - 2022-03-18 ### Added diff --git a/nucleus/dataset_item.py b/nucleus/dataset_item.py index c720f433..91513b1c 100644 --- a/nucleus/dataset_item.py +++ b/nucleus/dataset_item.py @@ -37,7 +37,7 @@ ) -class CameraModels(Enum): +class CameraModels(str, Enum): BROWN_CONRADY = "brown_conrady" FISHEYE = "fisheye" @@ -122,7 +122,7 @@ class CameraParams: def __post_init__(self): if self.camera_model is not None: - if self.camera_model not in CameraModels: + if self.camera_model not in (k for k in CameraModels): raise ValueError( f'Invalid Camera Model, the supported options are "{CameraModels.BROWN_CONRADY}" and "{CameraModels.FISHEYE}"' ) @@ -137,13 +137,13 @@ def from_json(cls, payload: Dict[str, Any]): payload[FY_KEY], payload[CX_KEY], payload[CY_KEY], + payload.get(CAMERA_MODEL_KEY, None), payload.get(K1_KEY, None), payload.get(K2_KEY, None), payload.get(K3_KEY, None), payload.get(K4_KEY, None), payload.get(P1_KEY, None), payload.get(P2_KEY, None), - payload.get(CAMERA_MODEL_KEY, None), ) def to_payload(self) -> dict: diff --git a/pyproject.toml b/pyproject.toml index cbdb92f0..712d9280 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ exclude = ''' [tool.poetry] name = "scale-nucleus" -version = "0.8.1" +version = "0.8.2" description = "The official Python client library for Nucleus, the Data Platform for AI" license = "MIT" authors = ["Scale AI Nucleus Team "]