1010 IMAGE_URL_KEY ,
1111 METADATA_KEY ,
1212 ORIGINAL_IMAGE_URL_KEY ,
13+ UPLOAD_TO_SCALE_KEY ,
1314 REFERENCE_ID_KEY ,
1415 TYPE_KEY ,
1516 URL_KEY ,
@@ -92,12 +93,17 @@ class DatasetItem: # pylint: disable=R0902
9293 reference_id : Optional [str ] = None
9394 metadata : Optional [dict ] = None
9495 pointcloud_location : Optional [str ] = None
96+ upload_to_scale : Optional [bool ] = True
9597
9698 def __post_init__ (self ):
9799 assert self .reference_id is not None , "reference_id is required."
98100 assert bool (self .image_location ) != bool (
99101 self .pointcloud_location
100102 ), "Must specify exactly one of the image_location, pointcloud_location parameters"
103+ if self .pointcloud_location and not self .upload_to_scale :
104+ raise NotImplementedError (
105+ "Skipping upload to Scale is not currently implemented for pointclouds."
106+ )
101107 self .local = (
102108 is_local_path (self .image_location ) if self .image_location else None
103109 )
@@ -133,6 +139,7 @@ def from_json(cls, payload: dict, is_scene=False):
133139 image_location = image_url ,
134140 reference_id = payload .get (REFERENCE_ID_KEY , None ),
135141 metadata = payload .get (METADATA_KEY , {}),
142+ upload_to_scale = payload .get (UPLOAD_TO_SCALE_KEY , None ),
136143 )
137144
138145 def local_file_exists (self ):
@@ -158,6 +165,7 @@ def to_payload(self, is_scene=False) -> dict:
158165 self .image_location
159166 ), "Must specify image_location for DatasetItems not in a LidarScene"
160167 payload [IMAGE_URL_KEY ] = self .image_location
168+ payload [UPLOAD_TO_SCALE_KEY ] = self .upload_to_scale
161169
162170 return payload
163171
0 commit comments