otx.api.entities.shapes.shape#
This file defines the ShapeEntity interface and the Shape abstract class.
Classes
|
Base class for Shape entities. |
|
This interface represents the annotation shapes on the media given by user annotations or system analysis. |
|
Shows which type of Shape is being used. |
Exceptions
Exception that is thrown if the geometry of a Shape is invalid. |
- exception otx.api.entities.shapes.shape.GeometryException[source]#
Bases:
ValueError
Exception that is thrown if the geometry of a Shape is invalid.
- class otx.api.entities.shapes.shape.Shape(shape_type: ShapeType, modification_date: datetime)[source]#
Bases:
ShapeEntity
Base class for Shape entities.
- contains_center(other: ShapeEntity) bool [source]#
Checks whether the center of the ‘other’ shape is located in the shape.
- Parameters:
other (ShapeEntity) – Shape to compare with.
- Returns:
Boolean that indicates whether the center of the other shape is located in the shape
- Return type:
- class otx.api.entities.shapes.shape.ShapeEntity(shape_type: ShapeType)[source]#
Bases:
object
This interface represents the annotation shapes on the media given by user annotations or system analysis.
The shapes is a 2D geometric shape living in a normalized coordinate system (the values range from 0 to 1).
- abstract contains_center(other: ShapeEntity) bool [source]#
Checks whether the center of the ‘other’ shape is located in the shape.
- Parameters:
other (ShapeEntity) – Shape to compare with
- Returns:
true if the center of the ‘other’ shape is located in the shape, otherwise returns false
- Return type:
- abstract denormalize_wrt_roi_shape(roi_shape: Rectangle) ShapeEntity [source]#
The inverse of normalize_wrt_roi_shape.
Transforming shape from the normalized coordinate system to the roi coordinate system. This is used to pull ground truth during training process of the tasks. Examples given in the Shape implementations.
- Parameters:
roi_shape (Rectangle) – Shape of the roi.
- Returns:
Shape in the roi coordinate system.
- Return type:
- abstract intersects(other: Shape) bool [source]#
Returns true if other intersects with shape, otherwise returns false.
- abstract normalize_wrt_roi_shape(roi_shape: Rectangle) Shape [source]#
The inverse of denormalize_wrt_roi_shape.
Transforming shape from the roi coordinate system to the normalized coordinate system. This is used when the tasks want to save the analysis results.
For example in Detection -> Segmentation pipeline, the analysis results of segmentation needs to be normalized to the roi (bounding boxes) coming from the detection.