44#
55
66from .image_model import ImageModel
7+ from .result_types import Detection
78from .types import ListValue , NumericalValue , StringValue
89from .utils import load_labels
910
@@ -37,6 +38,7 @@ def __init__(self, inference_adapter, configuration: dict = {}, preload=False):
3738 """
3839 super ().__init__ (inference_adapter , configuration , preload )
3940 self .path_to_labels : str
41+ self .confidence_threshold : float
4042 if not self .image_blob_name :
4143 self .raise_error (
4244 f"The Wrapper supports only one image input, but { len (self .image_blob_names )} found" ,
@@ -63,7 +65,7 @@ def parameters(cls):
6365
6466 return parameters
6567
66- def _resize_detections (self , detections , meta ):
68+ def _resize_detections (self , detections : list [ Detection ] , meta ):
6769 """Resizes detection bounding boxes according to initial image shape.
6870
6971 It implements image resizing depending on the set `resize_type`(see `ImageModel` for details).
@@ -117,7 +119,7 @@ def _clamp_and_round(val, min_value, max_value):
117119
118120 return detections
119121
120- def _filter_detections (self , detections , box_area_threshold = 0.0 ):
122+ def _filter_detections (self , detections : list [ Detection ] , box_area_threshold = 0.0 ):
121123 """Filters detections by confidence threshold and box size threshold
122124
123125 Args:
@@ -138,7 +140,7 @@ def _filter_detections(self, detections, box_area_threshold=0.0):
138140
139141 return filtered_detections
140142
141- def _add_label_names (self , detections ):
143+ def _add_label_names (self , detections : list [ Detection ] ):
142144 """Adds labels names to detections if they are available
143145
144146 Args:
0 commit comments