otx.algorithms.detection.utils#
Collection of utils for task implementation in Detection Task.
Functions
Get ModelAPI config. |
|
|
Load dataset from CocoDataset. |
|
Function to get sizes of instances in DatasetEntity and to resize it to the target size. |
|
Get anchor box widths & heights. |
|
Decrease floating point digits in logs. |
|
Generating label_schema function. |
|
Create prediction detection shapes. |
|
Create prediction mask shapes. |
- otx.algorithms.detection.utils.create_detection_shapes(pred_results: List[ndarray], width: int, height: int, confidence_threshold: float, use_ellipse_shapes: bool, labels: List)[source]#
Create prediction detection shapes.
- Parameters:
- Returns:
list of prediction shapes (Annotation)
- Return type:
shapes
- otx.algorithms.detection.utils.create_mask_shapes(pred_results: Tuple, width: int, height: int, confidence_threshold: float, use_ellipse_shapes: bool, labels: List, rotated_polygon: bool = False)[source]#
Create prediction mask shapes.
- Parameters:
pred_results (tuple) – tuple of predicted boxes and masks for each dataset item
width (int) – image width
height (int) – image height
confidence_threshold (float) – confidence threshold for filtering predictions
use_ellipse_shapes (bool) – if True, use ellipse shapes
labels (list) – dataset labels
rotated_polygon (bool, optional) – if True, use rotated polygons for mask shapes
- Returns:
list of prediction shapes (Annotation)
- Return type:
shapes
- otx.algorithms.detection.utils.format_list_to_str(value_lists: list)[source]#
Decrease floating point digits in logs.
- otx.algorithms.detection.utils.generate_label_schema(label_names: Sequence[str], label_domain: Domain = Domain.DETECTION)[source]#
Generating label_schema function.
- otx.algorithms.detection.utils.get_anchor_boxes(wh_stats: List[tuple], group_as: List[int])[source]#
Get anchor box widths & heights.
- otx.algorithms.detection.utils.get_det_model_api_configuration(label_schema: LabelSchemaEntity, task_type: TaskType, confidence_threshold: float, tiling_parameters: Any, use_ellipse_shapes: bool, nms_iou_threshold: float)[source]#
Get ModelAPI config.
- otx.algorithms.detection.utils.get_sizes_from_dataset_entity(dataset: DatasetEntity, target_wh: List[int])[source]#
Function to get sizes of instances in DatasetEntity and to resize it to the target size.
- Parameters:
dataset – DatasetEntity in which to get statistics
target_wh – target width and height of the dataset
- Return list:
tuples with width and height of each instance