svkcore.shapes
svkcore.shapes.shapes
Common shapes for object detection
- class svkcore.shapes.shapes.Box(obj, dtype=None)[source]
Bases:
Shape
Box of 2d. Record top_left and bottom_right corner position of box.
- bsize()[source]
Size of box
- Returns:
box size in format np.array([width, height])
- Return type:
np.ndarray
- classmethod from_cxywh(cxywh)[source]
Create box from format [min-x, min-y, max-x, max-y]
- Returns:
converted box in format [min-x, min-y, max-x, max-y]
- Return type:
- class svkcore.shapes.shapes.Boxes(obj, dtype=None)[source]
Bases:
Shape
Collection of Box
- bsize()[source]
Sizes of boxes
- Returns:
boxes sizes in format np.array([[width, height], …])
- Return type:
np.ndarray
- classmethod from_cxywh(cxywh)[source]
Create box from format [min-x, min-y, max-x, max-y]
- Returns:
converted box in format [min-x, min-y, max-x, max-y]
- Return type:
- class svkcore.shapes.shapes.Mask(obj, dtype=None)[source]
Bases:
Shape
Mask of 2d
- class svkcore.shapes.shapes.Polygon(obj, dtype=None)[source]
Bases:
Shape
Polygon of 2d
- area()[source]
Calculate polygon area use mask area calculate
- Returns:
polygon area
- Return type:
np.float