Skip to content

Commit 6f6c677

Browse files
authored
fix camera_model initialization (#264)
* fix camera_model initialization * bump version number
1 parent 9192734 commit 6f6c677

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to the [Nucleus Python Client](https://github.com/scaleapi/n
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [0.8.2](https://github.com/scaleapi/nucleus-python-client/releases/tag/v0.8.2) - 2022-03-18
8+
9+
### Added
10+
- a fix to the CameraModels enumeration to fix export of camera calibrations for 3D scenes
11+
712
## [0.8.1](https://github.com/scaleapi/nucleus-python-client/releases/tag/v0.8.0) - 2022-03-18
813

914
### Added

nucleus/dataset_item.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
)
3838

3939

40-
class CameraModels(Enum):
40+
class CameraModels(str, Enum):
4141
BROWN_CONRADY = "brown_conrady"
4242
FISHEYE = "fisheye"
4343

@@ -122,7 +122,7 @@ class CameraParams:
122122

123123
def __post_init__(self):
124124
if self.camera_model is not None:
125-
if self.camera_model not in CameraModels:
125+
if self.camera_model not in (k for k in CameraModels):
126126
raise ValueError(
127127
f'Invalid Camera Model, the supported options are "{CameraModels.BROWN_CONRADY}" and "{CameraModels.FISHEYE}"'
128128
)
@@ -137,13 +137,13 @@ def from_json(cls, payload: Dict[str, Any]):
137137
payload[FY_KEY],
138138
payload[CX_KEY],
139139
payload[CY_KEY],
140+
payload.get(CAMERA_MODEL_KEY, None),
140141
payload.get(K1_KEY, None),
141142
payload.get(K2_KEY, None),
142143
payload.get(K3_KEY, None),
143144
payload.get(K4_KEY, None),
144145
payload.get(P1_KEY, None),
145146
payload.get(P2_KEY, None),
146-
payload.get(CAMERA_MODEL_KEY, None),
147147
)
148148

149149
def to_payload(self) -> dict:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ exclude = '''
2121

2222
[tool.poetry]
2323
name = "scale-nucleus"
24-
version = "0.8.1"
24+
version = "0.8.2"
2525
description = "The official Python client library for Nucleus, the Data Platform for AI"
2626
license = "MIT"
2727
authors = ["Scale AI Nucleus Team <nucleusapi@scaleapi.com>"]

0 commit comments

Comments
 (0)