anns_from_hoverdict¶
- anns_from_hoverdict(data, props, typedict, origin, scale_factor)[source]¶
Helper function to create list of Annotation objects.
Creates annotations from a hovernet-style dict of segmentations, mapping types using type dict if provided.
- Parameters:
data (dict) – A dictionary of segmentations
props (list) – A list of properties
typedict (dict) – A dictionary mapping annotation types to more descriptive names.
origin (tuple[float, float]) – The x and y coordinates to use as the origin for the annotations.
scale_factor (tuple[float, float]) – The scale factor to use when loading the annotations. All coordinates will be multiplied by this factor.
- Returns:
A list of Annotation objects.
- Return type: