instancelabeling
instancelabeling ¶
Module for InstanceLabel
Classes¶
InstanceLabel ¶
Bases: ABC
Abstract class representing an instance of a found object. Additionally, this class is used for visualization purpose
Functions¶
calc_iou
abstractmethod
¶
Calculates the IOU of two given InstanceLabel
s
Parameters:
-
other
(InstanceLabel
) –InstanceLabel to calculate the IOU for
Returns:
-
float
–Calculated IOU
scale_label
abstractmethod
¶
Scales an instance label by a given scale_factor
Parameters:
-
scale_factor
(float
) –Factor to scale the instance label by
Returns:
-
InstanceLabel
–Scaled instance of this InstanceLabel
Source code in niceml/utilities/instancelabeling.py
Functions¶
get_kind_of_instance_label_match ¶
Defines color and activation of pred_label
and gt_label
based on an iou
and an iou_threshold
. Red = gt label with no matching prediction label;
Blue = prediction label with no matching gt label; Green = prediction label which
matched at least one gt label in position and class; Yellow = prediction label
which matched at least one gt label in position but not in class.
Parameters:
-
pred_label
(InstanceLabel
) –Prediction instance label
-
gt_label
(InstanceLabel
) –Ground truth instance label
-
iou
(float
) –Iou of
pred_label
andgt_label
-
iou_threshold
(float
) –Threshold to decide which color and activation should be used for the prediction and ground truth instance labels
-
hide_gt_over_thresh
(bool
) –Flag to hide the
gt_label
if theiou
is above theiou_threshold
Returns:
-
InstanceLabel
–Updated
pred_label
andgt_label
including -
InstanceLabel
–color and activation for instance label visualization