2222 TYPE_KEY ,
2323 UPLOAD_TO_SCALE_KEY ,
2424 URL_KEY ,
25- VIDEO_FRAME_URL_KEY ,
2625 W_KEY ,
2726 X_KEY ,
2827 Y_KEY ,
@@ -121,35 +120,26 @@ def to_payload(self) -> dict:
121120class DatasetItemType (Enum ):
122121 IMAGE = "image"
123122 POINTCLOUD = "pointcloud"
124- VIDEO = "video"
125123
126124
127125@dataclass # pylint: disable=R0902
128126class DatasetItem : # pylint: disable=R0902
129- """A dataset item is an image, pointcloud or video frame that has associated metadata.
127+ """A dataset item is an image or pointcloud that has associated metadata.
130128
131129 Note: for 3D data, please include a :class:`CameraParams` object under a key named
132130 "camera_params" within the metadata dictionary. This will allow for projecting
133131 3D annotations to any image within a scene.
134132
135133 Args:
136- image_location (Optional[str]): Required if pointcloud_location and
137- video_frame_location are not present: The location containing the image for
138- the given row of data. This can be a local path, or a remote URL. Remote
139- formats supported include any URL (``http://`` or ``https://``) or URIs for
140- AWS S3, Azure, or GCS (i.e. ``s3://``, ``gcs://``).
141-
142- pointcloud_location (Optional[str]): Required if image_location and
143- video_frame_location are not present: The remote URL containing the
144- pointcloud JSON. Remote formats supported include any URL (``http://``
145- or ``https://``) or URIs for AWS S3, Azure, or GCS (i.e. ``s3://``,
146- ``gcs://``).
147-
148- video_frame_location (Optional[str]): Required if image_location and
149- pointcloud_location are not present: The remote URL containing the
150- video frame image. Remote formats supported include any URL (``http://``
151- or ``https://``) or URIs for AWS S3, Azure, or GCS (i.e. ``s3://``,
152- ``gcs://``).
134+ image_location (Optional[str]): Required if pointcloud_location is not present:
135+ The location containing the image for the given row of data. This can be a local
136+ path, or a remote URL. Remote formats supported include any URL (``http://`` or
137+ ``https://``) or URIs for AWS S3, Azure, or GCS (i.e. ``s3://``, ``gcs://``).
138+
139+ pointcloud_location (Optional[str]): Required if image_location is not present:
140+ The remote URL containing the pointcloud JSON. Remote formats supported include
141+ any URL (``http://`` or ``https://``) or URIs for AWS S3, Azure, or GCS (i.e.
142+ ``s3://``, ``gcs://``).
153143
154144 reference_id (Optional[str]): A user-specified identifier to reference the
155145 item.
@@ -212,33 +202,23 @@ class DatasetItem: # pylint: disable=R0902
212202 metadata : Optional [dict ] = None
213203 pointcloud_location : Optional [str ] = None
214204 upload_to_scale : Optional [bool ] = True
215- video_frame_location : Optional [str ] = None
216205
217206 def __post_init__ (self ):
218207 assert self .reference_id != "DUMMY_VALUE" , "reference_id is required."
219- assert (
220- bool (self .image_location )
221- + bool (self .pointcloud_location )
222- + bool (self .video_frame_location )
223- == 1
224- ), "Must specify exactly one of the image_location, pointcloud_location, video_frame_location parameters"
225- if (
226- self .pointcloud_location or self .video_frame_location
227- ) and not self .upload_to_scale :
208+ assert bool (self .image_location ) != bool (
209+ self .pointcloud_location
210+ ), "Must specify exactly one of the image_location or pointcloud_location parameters"
211+ if (self .pointcloud_location ) and not self .upload_to_scale :
228212 raise NotImplementedError (
229- "Skipping upload to Scale is not currently implemented for pointclouds and videos ."
213+ "Skipping upload to Scale is not currently implemented for pointclouds."
230214 )
231215 self .local = (
232216 is_local_path (self .image_location ) if self .image_location else None
233217 )
234218 self .type = (
235219 DatasetItemType .IMAGE
236220 if self .image_location
237- else (
238- DatasetItemType .POINTCLOUD
239- if self .pointcloud_location
240- else DatasetItemType .VIDEO
241- )
221+ else DatasetItemType .POINTCLOUD
242222 )
243223 camera_params = (
244224 self .metadata .get (CAMERA_PARAMS_KEY , None )
@@ -258,7 +238,6 @@ def from_json(cls, payload: dict):
258238 return cls (
259239 image_location = image_url ,
260240 pointcloud_location = payload .get (POINTCLOUD_URL_KEY , None ),
261- video_frame_location = payload .get (VIDEO_FRAME_URL_KEY , None ),
262241 reference_id = payload .get (REFERENCE_ID_KEY , None ),
263242 metadata = payload .get (METADATA_KEY , {}),
264243 upload_to_scale = payload .get (UPLOAD_TO_SCALE_KEY , True ),
@@ -281,8 +260,6 @@ def to_payload(self, is_scene=False) -> dict:
281260 payload [URL_KEY ] = self .image_location
282261 elif self .pointcloud_location :
283262 payload [URL_KEY ] = self .pointcloud_location
284- elif self .video_frame_location :
285- payload [URL_KEY ] = self .video_frame_location
286263 payload [TYPE_KEY ] = self .type .value
287264 if self .camera_params :
288265 payload [CAMERA_PARAMS_KEY ] = self .camera_params .to_payload ()
0 commit comments