class documentation

class FramesView(Frames): (source)

Constructor: FramesView(sample_view)

View In Hierarchy

An ordered dictionary of FrameView instances keyed by frame number representing the frames of a video fiftyone.core.sample.SampleView.

FramesView instances behave like defaultdict(FrameView) instances; an empty FrameView instance is returned when accessing a new frame number.

FramesView instances should never be created manually; they are instantiated automatically when video fiftyone.core.sample.SampleView instances are created.

Parameters
sample_viewthe fiftyone.core.sample.SampleView to which the frames are attached
Method __init__ Undocumented
Method add_frame Adds the frame to this instance.
Method reload Reloads the view into the frames of the attached sample.
Method save Saves all frames for the sample to the database.
Property field_names An ordered tuple of the names of the fields on the frames.
Method _get_frame_db Undocumented
Method _get_frame_numbers_db Undocumented
Method _iter_frames_db Undocumented
Method _make_frame Undocumented
Method _reload_parents Undocumented
Method _save_replacements Undocumented
Instance Variable _delete_all Undocumented
Instance Variable _filtered_fields Undocumented
Instance Variable _frames_pipeline Undocumented
Instance Variable _needs_frames Undocumented
Instance Variable _view Undocumented

Inherited from Frames:

Method __bool__ Undocumented
Method __contains__ Undocumented
Method __delitem__ Undocumented
Method __getitem__ Undocumented
Method __iter__ Undocumented
Method __len__ Undocumented
Method __next__ Undocumented
Method __repr__ Undocumented
Method __setitem__ Undocumented
Method __str__ Undocumented
Method clear Removes all frames from this sample.
Method delete_frame Deletes the given frame number from this instance.
Method first Returns the first Frame for the sample.
Method head Returns a list of the first few frames for the sample.
Method items Returns an iterator over the frame numberes and Frame instances for the sample.
Method keys Returns an iterator over the frame numbers with labels in the sample.
Method last Returns the last Frame for the sample.
Method merge Merges the given frames into this instance.
Method tail Returns a list of the last few frames for the sample.
Method update Adds the frame labels to this instance.
Method values Returns an iterator over the Frame instances for the sample.
Method _get_frame_numbers Undocumented
Method _get_frames_match_stage Undocumented
Method _get_ids_map Undocumented
Method _iter_frames Undocumented
Method _make_dict Undocumented
Method _save Undocumented
Method _save_deletions Undocumented
Method _set_replacement Undocumented
Method _to_frames_dict Undocumented
Method _validate_frame Undocumented
Instance Variable _delete_frames Undocumented
Instance Variable _iter Undocumented
Instance Variable _replacements Undocumented
Instance Variable _sample Undocumented
Property _dataset Undocumented
Property _frame_collection Undocumented
Property _frame_collection_name Undocumented
Property _in_db Undocumented
Property _sample_collection Undocumented
Property _sample_id Undocumented
def __init__(self, sample_view): (source)

Undocumented

def add_frame(self, frame_number, frame, expand_schema=True, validate=True, dynamic=False): (source)

Adds the frame to this instance.

If an existing frame with the same frame number exists, it is overwritten.

Unlike Frames.add_frame, the provided frame is never modified in-place. Instead, a new FrameView is constructed internally with the contents of the provided frame.

Parameters
frame_numberthe frame number
framea Frame or FrameView
expand_schema:Truewhether to dynamically add new frame fields encountered to the dataset schema. If False, an error is raised if the frame's schema is not a subset of the dataset schema
validate:Truewhether to validate values for existing fields
dynamic:Falsewhether to declare dynamic embedded document fields
def reload(self): (source)

Reloads the view into the frames of the attached sample.

Calling this method has the following effects:

  • Clears the in-memory cache of FrameView instances that you have loaded via this object. Any frames that you subsequently access will be loaded directly from the database
  • Any additions, modifications, or deletions to frame views that you have loaded from this instance but not committed to the database by calling save will be discarded

Note

FrameView objects are not singletons, so calling this method will not have any effect on FrameView instances that you have previously loaded via this object

Parameters
hard:Falsewhether to reload the frame schema in addition to the field values for the frames. This is necessary if new fields may have been added to the dataset's frame schema
def save(self): (source)

Saves all frames for the sample to the database.

@property
field_names = (source)

An ordered tuple of the names of the fields on the frames.

def _get_frame_db(self, frame_number): (source)
def _get_frame_numbers_db(self): (source)
def _iter_frames_db(self): (source)
def _make_frame(self, d): (source)
def _reload_parents(self): (source)

Undocumented

def _save_replacements(self, validate=True, deferred=False): (source)
_filtered_fields = (source)

Undocumented

_frames_pipeline = (source)

Undocumented

_needs_frames = (source)

Undocumented

Undocumented