blendersynth.annotations.annotation_handler
- blendersynth.annotations.annotation_handler.ANN_TYPES = ['bbox', 'keypoints', 'axes']
Valid annotation types
- class blendersynth.annotations.annotation_handler.Annotation(bbox=None, keypoints=None, axes=None)[source]
A class for storing annotations for a single image.
- __init__(bbox=None, keypoints=None, axes=None)[source]
- Parameters:
bbox (
List
[Union
[mathutils.Vector,ndarray
,List
,Tuple
]]) – Bounding box tuple per instancekeypoints (
List
[ndarray
]) – [N x 2] array per instanceaxes (
List
[ndarray
]) – [4 x 2] array per instance
- set(item, value, inplace=False)[source]
Return a new Annotation, with item set to value.
- Parameters:
item (
str
) – A key inANN_TYPES
value – Value to set
inplace (
bool
) – If True, set in place and return self
- Return type:
- union(other, priority='other')[source]
Joins two annotations together, returning a new Annotation instance.
- Parameters:
other (
Annotation
) – Annotation to join withpriority – Which annotation to take priority when merging
- Return type:
- class blendersynth.annotations.annotation_handler.AnnotationHandler(data)[source]
An object for storing and handling per-view
Annotation
instances- classmethod from_annotations(data, ann_type='bbox')[source]
Create an Annotation Handler from a single type of annotation
- Parameters:
data (
dict
) – Dictionary of camera_name: annotation (e.g. bboxes)ann_type (
str
) – Type of annotation (e.g. ‘bbox’)
- Return type:
- get_annotation_by_camera(camera_name)[source]
Return annotation for a given camera (default to an empty
Annotation
instance if not found)- Return type:
- union(other, priority='other')[source]
Combine two AnnotationHandlers, merging annotations wherever possible. Returns a new instance comprising the union of the two AnnotationHandlers.
- Parameters:
other (
AnnotationHandler
) – AnnotationHandler to merge withpriority (
str
) – Which AnnotationHandler to take priority when merging
- Return type: