class FrameSingleton(DocumentSingleton): (source)
Constructor: FrameSingleton(*args, **kwargs)
Singleton metaclass for fiftyone.core.frame.Frame
.
This metaclass maintains a weakref dictionary of all in-memory
fiftyone.core.frame.Frame
instances keyed by
[collection name][sample ID][frame number].
Method | __new__ |
Undocumented |
Method | _clear |
Removes all frames for the given collection from the cache. |
Method | _clear |
Clears the values for the given fields (i.e., sets them to None) on all in-memory frames in the collection. |
Method | _get |
Retrieves the fiftyone.core.document.Document instance for the given document, if one exists. |
Method | _get |
Returns a frame number -> Frame dict containing all in-memory frame instances for the specified sample. |
Method | _purge |
Removes the fields from all in-memory frames in the collection. |
Method | _register |
Registers the given instance in the weakref dictionary. |
Method | _reload |
Reloads the backing document for the given frame if it is in-memory. |
Method | _reload |
Reloads the backing documents for in-memory frames in the collection. |
Method | _reload |
Reloads the backing document for the given instance (or view), if a reference exists to it. |
Method | _rename |
Renames the field on all in-memory frames in the collection. |
Method | _reset |
Resets the backing documents for in-memory frames in the collection. |
Method | _reset |
Resets the backing documents for all in-memory frames with the given frame IDs. |
Method | _reset |
Resets the backing documents for all in-memory frames with the given frame numbers attached to the specified sample. |
Method | _sync |
Syncs the backing documents for all in-memory frames according to the following rules: |
Method | _sync |
Syncs the backing documents for all in-memory frames attached to the specified sample according to the following rules: |
Clears the values for the given fields (i.e., sets them to None) on all in-memory frames in the collection.
Retrieves the fiftyone.core.document.Document
instance for
the given document, if one exists.
Parameters | |
cls | Undocumented |
doc | a fiftyone.core.odm.document.Document |
Returns | |
a fiftyone.core.document.Document instance, or None |
Returns a frame number -> Frame dict containing all in-memory frame instances for the specified sample.
Reloads the backing documents for in-memory frames in the collection.
If sample_ids are provided, only frames attached to samples with these IDs are reloaded.
Reloads the backing document for the given instance (or view), if a reference exists to it.
Parameters | |
cls | Undocumented |
obj | a Document or DocumentView |
Resets the backing documents for in-memory frames in the collection.
If sample_ids are provided, only frames attached to samples with the given sample IDs are reset.
Resets the backing documents for all in-memory frames with the given frame IDs.
When keep=True, all frames whose IDs are not in frame_ids are reset instead.
Resets the backing documents for all in-memory frames with the given frame numbers attached to the specified sample.
When keep=True, all frames whose frame numbers are not in frame_numbers are reset instead.
Syncs the backing documents for all in-memory frames according to the following rules:
- Frames attached to samples whose IDs are in sample_ids are reloaded
- Frames attached to samples whose IDs are not in sample_ids are reset