|
31 | 31 | from lib.app.helpers import extract_project_folder |
32 | 32 | from lib.app.helpers import get_annotation_paths |
33 | 33 | from lib.app.helpers import reformat_metrics_json |
| 34 | +from lib.app.interface.types import AnnotationType |
34 | 35 | from lib.app.interface.types import ClassesJson |
35 | 36 | from lib.app.interface.types import NotEmptyStr |
36 | 37 | from lib.app.interface.types import Status |
37 | | -from lib.app.interface.types import AnnotationType |
38 | 38 | from lib.app.interface.types import validate_arguments |
39 | 39 | from lib.app.mixp.decorators import Trackable |
40 | 40 | from lib.app.serializers import BaseSerializers |
@@ -2743,7 +2743,7 @@ def benchmark( |
2743 | 2743 | folder_names: List[str], |
2744 | 2744 | export_root: Optional[Union[str, Path]] = None, |
2745 | 2745 | image_list=None, |
2746 | | - annot_type=Optional[AnnotationType], |
| 2746 | + annot_type: Optional[AnnotationType] = "bbox", |
2747 | 2747 | show_plots=False, |
2748 | 2748 | ): |
2749 | 2749 | """Computes benchmark score for each instance of given images that are present both gt_project_name project and projects in folder_names list: |
@@ -3002,7 +3002,7 @@ def get_plottable_cols(df): |
3002 | 3002 | def add_annotation_bbox_to_image( |
3003 | 3003 | project: NotEmptyStr, |
3004 | 3004 | image_name: NotEmptyStr, |
3005 | | - bbox: List, |
| 3005 | + bbox: List[float], |
3006 | 3006 | annotation_class_name: NotEmptyStr, |
3007 | 3007 | annotation_class_attributes: Optional[List[NotEmptyStr]] = None, |
3008 | 3008 | error: Optional[StrictBool] = None, |
@@ -3037,7 +3037,7 @@ def add_annotation_bbox_to_image( |
3037 | 3037 | def add_annotation_polyline_to_image( |
3038 | 3038 | project: NotEmptyStr, |
3039 | 3039 | image_name: NotEmptyStr, |
3040 | | - polyline: List, |
| 3040 | + polyline: List[float], |
3041 | 3041 | annotation_class_name: NotEmptyStr, |
3042 | 3042 | annotation_class_attributes: Optional[List[NotEmptyStr]] = None, |
3043 | 3043 | error: Optional[StrictBool] = None, |
@@ -3071,9 +3071,9 @@ def add_annotation_polyline_to_image( |
3071 | 3071 | def add_annotation_polygon_to_image( |
3072 | 3072 | project: NotEmptyStr, |
3073 | 3073 | image_name: NotEmptyStr, |
3074 | | - polygon: List, |
| 3074 | + polygon: List[float], |
3075 | 3075 | annotation_class_name: NotEmptyStr, |
3076 | | - annotation_class_attributes = None, |
| 3076 | + annotation_class_attributes=None, |
3077 | 3077 | error: Optional[StrictBool] = None, |
3078 | 3078 | ): |
3079 | 3079 | """Add a polygon annotation to image annotations |
@@ -3106,7 +3106,7 @@ def add_annotation_polygon_to_image( |
3106 | 3106 | def add_annotation_point_to_image( |
3107 | 3107 | project: NotEmptyStr, |
3108 | 3108 | image_name: NotEmptyStr, |
3109 | | - point: List, |
| 3109 | + point: List[float], |
3110 | 3110 | annotation_class_name: NotEmptyStr, |
3111 | 3111 | annotation_class_attributes: Optional[List[NotEmptyStr]] = None, |
3112 | 3112 | error: Optional[StrictBool] = None, |
@@ -3139,7 +3139,7 @@ def add_annotation_point_to_image( |
3139 | 3139 | def add_annotation_ellipse_to_image( |
3140 | 3140 | project: NotEmptyStr, |
3141 | 3141 | image_name: NotEmptyStr, |
3142 | | - ellipse: List, |
| 3142 | + ellipse: List[float], |
3143 | 3143 | annotation_class_name: NotEmptyStr, |
3144 | 3144 | annotation_class_attributes: Optional[List[NotEmptyStr]] = None, |
3145 | 3145 | error: Optional[StrictBool] = None, |
@@ -3173,8 +3173,8 @@ def add_annotation_ellipse_to_image( |
3173 | 3173 | def add_annotation_template_to_image( |
3174 | 3174 | project: NotEmptyStr, |
3175 | 3175 | image_name: NotEmptyStr, |
3176 | | - template_points: List, |
3177 | | - template_connections: List, |
| 3176 | + template_points: List[float], |
| 3177 | + template_connections: List[int], |
3178 | 3178 | annotation_class_name: NotEmptyStr, |
3179 | 3179 | annotation_class_attributes: Optional[List[NotEmptyStr]] = None, |
3180 | 3180 | error: Optional[StrictBool] = None, |
@@ -3219,7 +3219,7 @@ def add_annotation_template_to_image( |
3219 | 3219 | def add_annotation_cuboid_to_image( |
3220 | 3220 | project: NotEmptyStr, |
3221 | 3221 | image_name: NotEmptyStr, |
3222 | | - cuboid: List, |
| 3222 | + cuboid: List[float], |
3223 | 3223 | annotation_class_name: NotEmptyStr, |
3224 | 3224 | annotation_class_attributes: Optional[List[NotEmptyStr]] = None, |
3225 | 3225 | error: Optional[StrictBool] = None, |
@@ -3256,7 +3256,7 @@ def add_annotation_comment_to_image( |
3256 | 3256 | project: NotEmptyStr, |
3257 | 3257 | image_name: NotEmptyStr, |
3258 | 3258 | comment_text: NotEmptyStr, |
3259 | | - comment_coords: List, |
| 3259 | + comment_coords: List[float], |
3260 | 3260 | comment_author: NotEmptyStr, |
3261 | 3261 | resolved: Optional[StrictBool] = False, |
3262 | 3262 | ): |
@@ -3541,7 +3541,7 @@ def _upload_s3_image(image_path: str): |
3541 | 3541 | @Trackable |
3542 | 3542 | @validate_arguments |
3543 | 3543 | def aggregate_annotations_as_df( |
3544 | | - project_root: Union[NotEmptyStr,Path], |
| 3544 | + project_root: Union[NotEmptyStr, Path], |
3545 | 3545 | include_classes_wo_annotations: Optional[StrictBool] = False, |
3546 | 3546 | include_comments: Optional[StrictBool] = False, |
3547 | 3547 | include_tags: Optional[StrictBool] = False, |
|
0 commit comments