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 | the fiftyone.core.sample.SampleView to which the
frames are attached |
Method | __init__ |
Undocumented |
Method | add |
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 |
An ordered tuple of the names of the fields on the frames. |
Method | _get |
Undocumented |
Method | _get |
Undocumented |
Method | _iter |
Undocumented |
Method | _make |
Undocumented |
Method | _reload |
Undocumented |
Method | _save |
Undocumented |
Instance Variable | _delete |
Undocumented |
Instance Variable | _filtered |
Undocumented |
Instance Variable | _frames |
Undocumented |
Instance Variable | _needs |
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 |
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 |
Undocumented |
Method | _get |
Undocumented |
Method | _get |
Undocumented |
Method | _iter |
Undocumented |
Method | _make |
Undocumented |
Method | _save |
Undocumented |
Method | _save |
Undocumented |
Method | _set |
Undocumented |
Method | _to |
Undocumented |
Method | _validate |
Undocumented |
Instance Variable | _delete |
Undocumented |
Instance Variable | _iter |
Undocumented |
Instance Variable | _replacements |
Undocumented |
Instance Variable | _sample |
Undocumented |
Property | _dataset |
Undocumented |
Property | _frame |
Undocumented |
Property | _frame |
Undocumented |
Property | _in |
Undocumented |
Property | _sample |
Undocumented |
Property | _sample |
Undocumented |
fiftyone.core.frame.Frames.add_frame
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 | the frame number |
frame | a Frame or FrameView |
expandTrue | whether 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:True | whether to validate values for existing fields |
dynamic:False | whether to declare dynamic embedded document fields |
fiftyone.core.frame.Frames.reload
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:False | whether 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 |
fiftyone.core.frame.Frames.field_names
An ordered tuple of the names of the fields on the frames.