Welcome to Image Semantics’s documentation!¶
Warning
Currently a work in progress!
Image understanding is widely used in many areas like satellite imaging, robotic technologies, sensory networks, medical and biomedical imaging, intelligent transportation systems, etc. Recently semantic analysis has become an active research topic aimed at resolving the gap between low level image features and high level semantics which is a promoting approach in image understanding.
With many image annotation semantics existing in the field of computer vision, it can become daunting to manage. This package provides the ability to convert and visualize many different types of annotation formats for object dectection and localization.
API Reference¶
If you are looking for information on a specific function, class or method, this part of the documentation is for you.
API¶
This part of the documentation covers all the interfaces of Image Segmantic.
Annotation Object¶
-
class
imantics.
Annotation
(image, category, bbox=None, mask=None, polygons=None, id=0, color=None, metadata={})[source]¶ Annotation is a marking on an image.
This class acts as a level ontop of
BBox
,Mask
andPolygons
to manage and generate other annotations or export formats.-
area
¶ Qantity that expresses the extent of a two-dimensional figure
-
array
¶ Numpy array boolean mask repsentation of the annotations
-
export
(style='coco')¶ Exports object into specified style
-
classmethod
from_bbox
(image, category, bbox)[source]¶ Creates annotation from bounding box
Parameters:
-
classmethod
from_mask
(image, category, mask)[source]¶ Creates annotation class from a mask
Parameters:
-
classmethod
from_polygons
(image, category, polygons)[source]¶ Creates annotation from polygons
Accepts following format for lists:
# Segmentation Format [ [x1, y1, x2, y2, x3, y3,...], [x1, y1, x2, y2, x3, y3,...], ... ]
or
# Point Format [ [[x1, y1], [x2, y2], [x3, y3],...], [[x1, y1], [x2, y2], [x3, y3],...], ... ]
No sepcificaiton is reqiured between which format is used
Parameters:
-
size
¶ Tuple of width and height
-
Category Object¶
Bounding Box Object¶
Dataset Object¶
Image Object¶
-
class
imantics.
Image
(image_array, annotations=[], path='', id=0, metadata={})[source]¶ -
add
(annotation, category=None)[source]¶ Adds a annotaiton, list of annotaitons, mask, polygon or bbox to current image. If annotation is not a Annotation a category is required List of non-Annotaiton objects will have the same category
Parameters: - annotation – annotaiton to add to current image
- category – required if annotation is not an Annotation object
-
export
(style='coco')¶ Exports object into specified style
-
Mask Object¶
-
class
imantics.
Mask
(array)[source]¶ Mask class
-
contains
(item)[source]¶ Checks whether a point (tuple), array or mask is within current mask. Note: Masks and arrays must be fully contained to return True
Parameters: item – object to check Returns: boolean if item is contained
-
intersect
(other)[source]¶ Intersects the array of the specified mask with this masks’s array and returns the result as a new mask.
Parameters: other – mask (or numpy array) to intersect with Returns: resulting mask
-
iou
(other)[source]¶ Intersect over union value of the specified masks
Parameters: other – mask (or numpy array) to compute value with Returns: resulting float value
-