FrameGroup
class dataframe.FrameGroup(id=None, metadata=None, *args, **kwargs)
Represents a group of frames, in the form of a dictionary
Initialize with a list of SingleFrame and key names
Parameters
id (str ) – Set the frame group’s unique ID (string representation must be alphanumeric). If the ID is None, a unique UUID will be generated based on the args/kwargs dictionary items if no args/kwargs provided, a unique UUID will be automatically generated for the frame
metadata (dict ) – General purpose dictionary (dict) stored alongside the frame group. Dict must be json-able. Notice: metadata keys cannot be the same as the source keys of the SingleFrames
kwargs (
SingleFrame
) – key/SingleFrame collection (like dict initialization) image1=SingleFrame()args (Union [ dict , SingleFrame ] ) –
Return type
None
id
property id
Return type
str
Returns
UUID representing the frame in the entire system
metadata
property metadata
Get the FrameGroup level metadata.
Return type
dict
Returns
General purpose dictionary (dict) stored alongside the frame group. Dict must be json-able.
origin
property origin
Returns the frame’s owner dataset/version information (Dataset is a collection of Versions), including Dataset ID, Dataset Name, Version ID and Version Name. Note: This is an auto-generated read-only property.
Return type
Dict
[str
,str
]
dataset_version_metadata
property dataset_version_metadata
Returns the frame’s owner dataset version meta-data (Read-Only).
Return type
dict
Returns
dict
blob
property blob
Return type
str
Returns
Non-Indexed data (string) stored alongside the frame group
to_dict
to_dict()
Return REST API compliant dictionary
Return type
dict
Returns
API compliant dictionary for use directly with REST-API
copy
copy()
Returns a copy of this FrameGroup, with a NEW RANDOM UUID.
Return type
FrameGroup
Returns
FrameGroup object
get_global_annotations
get_global_annotations()
Get a list of global annotations. Since global annotations are present in all single frames of this frame group, this method will return a list of the global annotations from one of the single frames.
Return type
List
[Annotation
]
add_global_annotation
add_global_annotation(annotation)
Add a global annotation instance. A copy of the instance will be added to every single frame.
Parameters
annotation (
Annotation
) – An Annotation instanceReturn type
None
remove_global_annotation
remove_global_annotation(annotation)
Remove a global annotation instance. The annotation is removed from all single frames, and located using an equality test.
Parameters
annotation (
Annotation
) – An Annotation instanceReturn type
bool
Returns
True if annotation was successfully removed from all single frames, False otherwise.
clear
clear() -> None. Remove all items from D.
get
get(k, [d]) -> D[k] if k in D, else d. d defaults to None.
items
items() -> a set-like object providing a view on D’s items
keys
keys() -> a set-like object providing a view on D’s keys
pop
pop(k, [d]) -> v, remove specified key and return the corresponding value.
If key is not found, d is returned if given, otherwise KeyError is raised.
popitem
popitem() -> (k, v), remove and return some (key, value) pair
as a 2-tuple; but raise KeyError if D is empty.
setdefault
setdefault(k, [d]) -> D.get(k,d), also set D[k]=d if k not in D
update
update([E], F) -> None. Update D from mapping/iterable E and F.**
If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
values
values() -> an object providing a view on D’s values
FrameGroup.from_dict
classmethod from_dict(framegroup_dict)
Build a FrameGroup from REST API compliant dictionary
Parameters
framegroup_dict (dict ) – a dictionary returned from FrameGroup.to_dict()
Return type
FrameGroup
Returns
FrameGroup object built from REST API dictionary