1414 POINTCLOUD_LOCATION_KEY ,
1515 REFERENCE_ID_KEY ,
1616 TRACKS_KEY ,
17- UPLOAD_TO_SCALE_KEY ,
1817 VIDEO_LOCATION_KEY ,
1918 VIDEO_URL_KEY ,
2019)
@@ -496,13 +495,6 @@ class VideoScene(ABC):
496495 Context Attachments may be provided to display the attachments side by side with the dataset
497496 item in the Detail View by specifying
498497 `{ "context_attachments": [ { "attachment": 'https://example.com/1' }, { "attachment": 'https://example.com/2' }, ... ] }`.
499- upload_to_scale (Optional[bool]): Set this to false in order to use
500- `privacy mode <https://nucleus.scale.com/docs/privacy-mode>`_. If using privacy mode
501- you must upload both a video_location and items to the VideoScene.
502-
503- Setting this to false means the actual data within the video scene will not be
504- uploaded to scale meaning that you can send in links that are only accessible
505- to certain users, and not to Scale.
506498
507499 Refer to our `guide to uploading video data
508500 <https://nucleus.scale.com/docs/uploading-video-data>`_ for more info!
@@ -513,7 +505,6 @@ class VideoScene(ABC):
513505 video_location : Optional [str ] = None
514506 items : List [DatasetItem ] = field (default_factory = list )
515507 metadata : Optional [dict ] = field (default_factory = dict )
516- upload_to_scale : Optional [bool ] = True
517508 attachment_type : Optional [str ] = None
518509 tracks : List [Track ] = field (default_factory = list )
519510
@@ -540,34 +531,14 @@ def __eq__(self, other):
540531 @property
541532 def length (self ) -> int :
542533 """Gets number of items in the scene for videos uploaded with an array of images."""
543- assert (
544- not self .upload_to_scale or not self .video_location
545- ), "Only videos with items have a length"
546534 return len (self .items )
547535
548536 def validate (self ):
549537 # TODO: make private
550538 assert (
551539 self .items or self .video_location
552540 ), "Please upload either a video_location or an array of dataset items representing frames"
553- if self .upload_to_scale is False :
554- assert (
555- self .frame_rate > 0
556- ), "When using privacy mode frame rate must be at least 1"
557- assert (
558- self .items and self .length > 0
559- ), "When using privacy mode scene must have a list of items of length at least 1"
560- for item in self .items :
561- assert isinstance (
562- item , DatasetItem
563- ), "Each item in a scene must be a DatasetItem object"
564- assert (
565- item .image_location is not None
566- ), "Each item in a video scene must have an image_location"
567- assert (
568- item .upload_to_scale is not False
569- ), "Please specify whether to upload to scale in the VideoScene for videos"
570- elif self .items :
541+ if self .items :
571542 assert (
572543 self .frame_rate > 0
573544 ), "When uploading an array of items frame rate must be at least 1"
@@ -584,9 +555,6 @@ def validate(self):
584555 assert (
585556 item .image_location is not None
586557 ), "Each item in a video scene must have an image_location"
587- assert (
588- item .upload_to_scale is not False
589- ), "Please specify whether to upload to scale in the VideoScene for videos"
590558 else :
591559 assert (
592560 not self .frame_rate
@@ -610,7 +578,7 @@ def add_item(
610578 exists. Default is False.
611579 """
612580 assert (
613- not self .upload_to_scale or not self . video_location
581+ not self .video_location
614582 ), "Cannot add item to a video without items"
615583 if index is None :
616584 index = len (self .items )
@@ -631,7 +599,7 @@ def get_item(self, index: int) -> DatasetItem:
631599 Return:
632600 :class:`DatasetItem`: DatasetItem at the specified index."""
633601 assert (
634- not self .upload_to_scale or not self . video_location
602+ not self .video_location
635603 ), "Cannot add item to a video without items"
636604 if index < 0 or index > len (self .items ):
637605 raise ValueError (
@@ -646,7 +614,7 @@ def get_items(self) -> List[DatasetItem]:
646614 List[:class:`DatasetItem`]: List of DatasetItems, sorted by index ascending.
647615 """
648616 assert (
649- not self .upload_to_scale or not self . video_location
617+ not self .video_location
650618 ), "Cannot add item to a video without items"
651619 return self .items
652620
@@ -672,9 +640,6 @@ def info(self):
672640 payload [VIDEO_URL_KEY ] = self .video_location
673641 if self .items :
674642 payload [LENGTH_KEY ] = self .length
675- if self .upload_to_scale :
676- payload [UPLOAD_TO_SCALE_KEY ] = self .upload_to_scale
677-
678643 return payload
679644
680645 @classmethod
@@ -699,7 +664,6 @@ def from_json(
699664 items = items ,
700665 metadata = payload .get (METADATA_KEY , {}),
701666 video_location = payload .get (VIDEO_URL_KEY , None ),
702- upload_to_scale = payload .get (UPLOAD_TO_SCALE_KEY , True ),
703667 tracks = tracks ,
704668 )
705669
@@ -720,8 +684,6 @@ def to_payload(self) -> dict:
720684 item .to_payload (is_scene = True ) for item in self .items
721685 ]
722686 payload [FRAMES_KEY ] = items_payload
723- if self .upload_to_scale is not None :
724- payload [UPLOAD_TO_SCALE_KEY ] = self .upload_to_scale
725687 if self .tracks :
726688 payload [TRACKS_KEY ] = [track .to_payload () for track in self .tracks ]
727689 return payload
0 commit comments