|
30 | 30 | from lib.app.interface.types import AnnotationType |
31 | 31 | from lib.app.interface.types import ImageQualityChoices |
32 | 32 | from lib.app.interface.types import NotEmptyStr |
33 | | -from lib.app.interface.types import Status |
34 | 33 | from lib.app.interface.types import validate_arguments |
35 | 34 | from lib.app.mixp.decorators import Trackable |
36 | 35 | from lib.app.serializers import BaseSerializers |
@@ -280,7 +279,7 @@ def clone_project( |
280 | 279 | def search_images( |
281 | 280 | project: Union[NotEmptyStr, dict], |
282 | 281 | image_name_prefix: Optional[NotEmptyStr] = None, |
283 | | - annotation_status: Optional[Status] = None, |
| 282 | + annotation_status: Optional[AnnotationStatuses] = None, |
284 | 283 | return_metadata: Optional[StrictBool] = False, |
285 | 284 | ): |
286 | 285 | """Search images by name_prefix (case-insensitive) and annotation status |
@@ -333,10 +332,6 @@ def create_folder(project: NotEmptyStr, folder_name: NotEmptyStr): |
333 | 332 | res = controller.create_folder(project=project, folder_name=folder_name) |
334 | 333 | if res.data: |
335 | 334 | folder = res.data |
336 | | - if folder and folder.name != folder_name: |
337 | | - logger.warning( |
338 | | - f"Created folder has name {folder.name}, since folder with name {folder_name} already existed.", |
339 | | - ) |
340 | 335 | logger.info(f"Folder {folder.name} created in project {project}") |
341 | 336 | return folder.to_dict() |
342 | 337 | if res.errors: |
@@ -603,7 +598,7 @@ def upload_images_from_public_urls_to_project( |
603 | 598 | project: Union[NotEmptyStr, dict], |
604 | 599 | img_urls: List[NotEmptyStr], |
605 | 600 | img_names: Optional[List[NotEmptyStr]] = None, |
606 | | - annotation_status: Optional[Status] = "NotStarted", |
| 601 | + annotation_status: Optional[AnnotationStatuses] = "NotStarted", |
607 | 602 | image_quality_in_editor: Optional[NotEmptyStr] = None, |
608 | 603 | ): |
609 | 604 | """Uploads all images given in the list of URL strings in img_urls to the project. |
@@ -1641,7 +1636,7 @@ def upload_videos_from_folder_to_project( |
1641 | 1636 | target_fps: Optional[int] = None, |
1642 | 1637 | start_time: Optional[float] = 0.0, |
1643 | 1638 | end_time: Optional[float] = None, |
1644 | | - annotation_status: Optional[Status] = "NotStarted", |
| 1639 | + annotation_status: Optional[AnnotationStatuses] = "NotStarted", |
1645 | 1640 | image_quality_in_editor: Optional[str] = None, |
1646 | 1641 | ): |
1647 | 1642 | """Uploads image frames from all videos with given extensions from folder_path to the project. |
@@ -1705,11 +1700,7 @@ def upload_videos_from_folder_to_project( |
1705 | 1700 | project_folder_name = project_name + (f"/{folder_name}" if folder_name else "") |
1706 | 1701 |
|
1707 | 1702 | logger.info( |
1708 | | - "Uploading all videos with extensions %s from %s to project %s. Excluded file patterns are: %s.", |
1709 | | - extensions, |
1710 | | - str(folder_path), |
1711 | | - project_name, |
1712 | | - exclude_file_patterns, |
| 1703 | + f"Uploading all videos with extensions {extensions} from {str(folder_path)} to project {project_name}. Excluded file patterns are: {[*exclude_file_patterns]}.", |
1713 | 1704 | ) |
1714 | 1705 | uploaded_paths = [] |
1715 | 1706 | for path in video_paths: |
@@ -1778,7 +1769,7 @@ def upload_video_to_project( |
1778 | 1769 | target_fps: Optional[int] = None, |
1779 | 1770 | start_time: Optional[float] = 0.0, |
1780 | 1771 | end_time: Optional[float] = None, |
1781 | | - annotation_status: Optional[Status] = "NotStarted", |
| 1772 | + annotation_status: Optional[AnnotationStatuses] = "NotStarted", |
1782 | 1773 | image_quality_in_editor: Optional[NotEmptyStr] = None, |
1783 | 1774 | ): |
1784 | 1775 | """Uploads image frames from video to platform. Uploaded images will have |
@@ -2235,7 +2226,7 @@ def download_image( |
2235 | 2226 | def attach_image_urls_to_project( |
2236 | 2227 | project: Union[NotEmptyStr, dict], |
2237 | 2228 | attachments: Union[str, Path], |
2238 | | - annotation_status: Optional[Status] = "NotStarted", |
| 2229 | + annotation_status: Optional[AnnotationStatuses] = "NotStarted", |
2239 | 2230 | ): |
2240 | 2231 | """Link images on external storage to SuperAnnotate. |
2241 | 2232 |
|
@@ -2298,7 +2289,7 @@ def attach_image_urls_to_project( |
2298 | 2289 | def attach_video_urls_to_project( |
2299 | 2290 | project: Union[NotEmptyStr, dict], |
2300 | 2291 | attachments: Union[str, Path], |
2301 | | - annotation_status: Optional[Status] = "NotStarted", |
| 2292 | + annotation_status: Optional[AnnotationStatuses] = "NotStarted", |
2302 | 2293 | ): |
2303 | 2294 | """Link videos on external storage to SuperAnnotate. |
2304 | 2295 |
|
@@ -3314,7 +3305,7 @@ def upload_image_to_project( |
3314 | 3305 | project: NotEmptyStr, |
3315 | 3306 | img, |
3316 | 3307 | image_name: Optional[NotEmptyStr] = None, |
3317 | | - annotation_status: Optional[Status] = "NotStarted", |
| 3308 | + annotation_status: Optional[AnnotationStatuses] = "NotStarted", |
3318 | 3309 | from_s3_bucket=None, |
3319 | 3310 | image_quality_in_editor: Optional[NotEmptyStr] = None, |
3320 | 3311 | ): |
@@ -3389,7 +3380,7 @@ def search_models( |
3389 | 3380 | def upload_images_to_project( |
3390 | 3381 | project: NotEmptyStr, |
3391 | 3382 | img_paths: List[NotEmptyStr], |
3392 | | - annotation_status: Optional[Status] = "NotStarted", |
| 3383 | + annotation_status: Optional[AnnotationStatuses] = "NotStarted", |
3393 | 3384 | from_s3_bucket=None, |
3394 | 3385 | image_quality_in_editor: Optional[ImageQualityChoices] = None, |
3395 | 3386 | ): |
@@ -3523,7 +3514,7 @@ def delete_annotations( |
3523 | 3514 | def attach_document_urls_to_project( |
3524 | 3515 | project: Union[NotEmptyStr, dict], |
3525 | 3516 | attachments: Union[Path, NotEmptyStr], |
3526 | | - annotation_status: Optional[Status] = "NotStarted", |
| 3517 | + annotation_status: Optional[AnnotationStatuses] = "NotStarted", |
3527 | 3518 | ): |
3528 | 3519 | """Link documents on external storage to SuperAnnotate. |
3529 | 3520 |
|
|
0 commit comments