ObjectInstance Objects
is_assigned_to_label_row
object_hash
ontology_item
feature_hash
object_name
get_answer
None
if the attribute is not yet answered.
For the ChecklistAttribute, it returns None if and only if
the attribute is nested and the parent is unselected. Otherwise, if not yet answered it will return an empty
list.
Arguments:
attribute
- The ontology attribute to get the answer for.filter_answer
- A filter for a specific answer value. Only applies to dynamic attributes.filter_frame
- A filter for a specific frame. Only applies to dynamic attributes.is_dynamic
- Optionally specify whether a dynamic answer is expected or not. This will throw if it is set incorrectly according to the attribute. Set this to narrow down the return type.
set_answer
answer
- The answer to set.attribute
- The ontology attribute to set the answer for. If not set, this will be attempted to be inferred. For answers to :class:encord.objects.common.RadioAttribute
or :class:encord.objects.common.ChecklistAttribute
, this can be inferred automatically. For :class:encord.objects.common.TextAttribute
or :class:encord.objects.common.NumericAttribute
, this will only be inferred if there is only one possible TextAttribute or NumericAttribute to set for the entire object instance. Otherwise, a :class:encord.exceptionsLabelRowError
will be thrown.frames
- Only relevant for dynamic attributes. The frames to set the answer for. IfNone
, the answer is set for all frames that this object currently has set coordinates for (also overwriting current answers). This will not automatically propagate the answer to new frames that are added in the future. If this is anything butNone
for non-dynamic attributes, this will throw a ValueError.overwrite
- IfTrue
, the answer will be overwritten if it already exists. IfFalse
, this will throw a LabelRowError if the answer already exists. This argument is ignored for dynamic attributes.manual_annotation
- IfTrue
, the answer will be marked as manually annotated. This arg defaults to DEFAULT_MANUAL_ANNOTATION.
set_answer_from_list
answers_list
- The list of dictionaries to set the answer from.
delete_answer
attribute
- The attribute to delete the answer for.filter_answer
- A filter for a specific answer value. Delete only answers with the provided value. Only applies to dynamic attributes.filter_frame
- A filter for a specific frame. Only applies to dynamic attributes.
check_within_range
frame
- The frame number to check.
LabelRowError
- If the frame is out of the acceptable range.
set_for_frames
True
,
the currently specified values will be overwritten.
Arguments:
coordinates
- The coordinates of the object in the frame. This will throw an error if the type of the coordinates does not match the type of the attribute in the object instance.frames
- The frames to add the object instance to. Defaults to the first frame for convenience.overwrite
- IfTrue
, overwrite existing data for the given frames. This will not reset all the non-specified values. IfFalse
and data already exists for the given frames, raises an error.created_at
- Optionally specify the creation time of the object instance on this frame. Defaults todatetime.now()
.created_by
- Optionally specify the creator of the object instance on this frame. Defaults to the current SDK user.last_edited_at
- Optionally specify the last edit time of the object instance on this frame. Defaults todatetime.now()
.last_edited_by
- Optionally specify the last editor of the object instance on this frame. Defaults to the current SDK user.confidence
- Optionally specify the confidence of the object instance on this frame. Defaults to1.0
.manual_annotation
- Optionally specify whether the object instance on this frame was manually annotated. Defaults toTrue
.reviews
- Should only be set by internal functions.is_deleted
- Should only be set by internal functions.
get_annotation
frame
- Either the frame number or the image hash if the data type is an image or image group. Defaults to the first frame.
Annotation
- The annotation for the specified frame.
LabelRowError
- If the frame is not present in the label row.
copy
LabelRowV2
.
This is useful for adding the semantically same ObjectInstance to multiple LabelRowV2
s.
Returns:
ObjectInstance
- A new ObjectInstance that is a copy of the current instance.
get_annotations
List[Annotation]
- A list ofObjectInstance.Annotation
in order of available frames.
get_annotation_frames
List[Annotation]
- A list ofObjectInstance.Annotation
in order of available frames.
remove_from_frames
frames
- The frames from which to remove the object instance.
is_valid
LabelRowError
- If the ObjectInstance is not on any frames.
are_dynamic_answers_valid
LabelRowError
- If there are dynamic answers on frames without coordinates.
Annotation Objects
created_by
last_edited_by
reviews
is_deleted
Optional[bool]
-True
if deleted,False
otherwise, orNone
if not set.
FrameInfo Objects
created_by
None defaults to the user of the SDK once uploaded to the server.last_edited_by
None defaults to the user of the SDK once uploaded to the server.from_dict
d
- A dictionary containing frame information.
ObjectInstance.FrameInfo
- An instance of FrameInfo.
update_from_optional_fields
created_at
- Optional creation time.created_by
- Optional creator identifier.last_edited_at
- Optional last edited time.last_edited_by
- Optional last editor identifier.confidence
- Optional confidence value.manual_annotation
- Optional manual annotation flag.reviews
- Optional list of reviews.is_deleted
- Optional deleted flag.
FrameData Objects
coordinates
Coordinates - The coordinates associated with the frame.object_frame_instance_info
ObjectInstance.FrameInfo - The frame’s metadata information.
check_coordinate_type
coordinates
Coordinates - The coordinates to check.ontology_object
Object - The ontology object to check against.parent
LabelRowV2 - The parent label row (if any) of the ontology object.
LabelRowError
- If the coordinate type does not match the expected type.