diff --git a/fastlabel/__init__.py b/fastlabel/__init__.py index 58b8edd..42df9a9 100644 --- a/fastlabel/__init__.py +++ b/fastlabel/__init__.py @@ -20,6 +20,7 @@ POSE_ESTIMATION_MIN_STROKE_WIDTH, SEPARATOER, AnnotationType, + Priority, ) from .api import Api @@ -783,6 +784,7 @@ def create_image_task( file_path: str, status: str = None, external_status: str = None, + priority: Priority = None, annotations: list = [], tags: list = [], **kwargs, @@ -796,6 +798,12 @@ def create_image_task( status can be 'registered', 'completed', 'skipped', 'reviewed', 'sent_back', 'approved', 'declined' (Optional). external_status can be 'registered', 'completed', 'skipped', 'reviewed', + priority is the priority of the task (default: none) (Optional). + Set one of the numbers corresponding to: + none = 0, + low = 10, + medium = 20, + high = 30, 'sent_back', 'approved', 'declined', 'customer_declined' (Optional). annotations is a list of annotation to be set in advance (Optional). tags is a list of tag to be set in advance (Optional). @@ -820,6 +828,8 @@ def create_image_task( payload["status"] = status if external_status: payload["externalStatus"] = external_status + if priority is not None: + payload["priority"] = priority if annotations: for annotation in annotations: annotation["content"] = name @@ -838,6 +848,7 @@ def create_image_classification_task( file_path: str, status: str = None, external_status: str = None, + priority: Priority = None, attributes: list = [], tags: list = [], **kwargs, @@ -851,6 +862,12 @@ def create_image_classification_task( status can be 'registered', 'completed', 'skipped', 'reviewed', 'sent_back', 'approved', 'declined' (Optional). external_status can be 'registered', 'completed', 'skipped', 'reviewed', + priority is the priority of the task (default: none) (Optional). + Set one of the numbers corresponding to: + none = 0, + low = 10, + medium = 20, + high = 30, 'sent_back', 'approved', 'declined', 'customer_declined' (Optional). attributes is a list of attribute to be set in advance (Optional). tags is a list of tag to be set in advance (Optional). @@ -875,6 +892,8 @@ def create_image_classification_task( payload["status"] = status if external_status: payload["externalStatus"] = external_status + if priority is not None: + payload["priority"] = priority if attributes: payload["attributes"] = attributes if tags: @@ -891,6 +910,7 @@ def create_multi_image_task( folder_path: str, status: str = None, external_status: str = None, + priority: Priority = None, annotations: list = [], tags: list = [], **kwargs, @@ -906,6 +926,12 @@ def create_multi_image_task( status can be 'registered', 'completed', 'skipped', 'reviewed', 'sent_back', 'approved', 'declined' (Optional). external_status can be 'registered', 'completed', 'skipped', 'reviewed', + priority is the priority of the task (default: none) (Optional). + Set one of the numbers corresponding to: + none = 0, + low = 10, + medium = 20, + high = 30, 'sent_back', 'approved', 'declined', 'customer_declined' (Optional). annotations is a list of annotation to be set in advance (Optional). tags is a list of tag to be set in advance (Optional). @@ -956,6 +982,8 @@ def create_multi_image_task( payload["status"] = status if external_status: payload["externalStatus"] = external_status + if priority is not None: + payload["priority"] = priority if annotations: payload["annotations"] = annotations if tags: @@ -972,6 +1000,7 @@ def create_video_task( file_path: str, status: str = None, external_status: str = None, + priority: Priority = None, annotations: list = [], tags: list = [], **kwargs, @@ -985,6 +1014,12 @@ def create_video_task( status can be 'registered', 'completed', 'skipped', 'reviewed', 'sent_back', 'approved', 'declined' (Optional). external_status can be 'registered', 'completed', 'skipped', 'reviewed', + priority is the priority of the task (default: none) (Optional). + Set one of the numbers corresponding to: + none = 0, + low = 10, + medium = 20, + high = 30, 'sent_back', 'approved', 'declined', 'customer_declined' (Optional). annotations is a list of annotation to be set in advance (Optional). tags is a list of tag to be set in advance (Optional). @@ -1009,6 +1044,8 @@ def create_video_task( payload["status"] = status if external_status: payload["externalStatus"] = external_status + if priority is not None: + payload["priority"] = priority if annotations: for annotation in annotations: annotation["content"] = name @@ -1027,6 +1064,7 @@ def create_video_classification_task( file_path: str, status: str = None, external_status: str = None, + priority: Priority = None, attributes: list = [], tags: list = [], **kwargs, @@ -1040,6 +1078,12 @@ def create_video_classification_task( status can be 'registered', 'completed', 'skipped', 'reviewed', 'sent_back', 'approved', 'declined' (Optional). external_status can be 'registered', 'completed', 'skipped', 'reviewed', + priority is the priority of the task (default: none) (Optional). + Set one of the numbers corresponding to: + none = 0, + low = 10, + medium = 20, + high = 30, 'sent_back', 'approved', 'declined', 'customer_declined' (Optional). attributes is a list of attribute to be set in advance (Optional). tags is a list of tag to be set in advance (Optional). @@ -1064,6 +1108,8 @@ def create_video_classification_task( payload["status"] = status if external_status: payload["externalStatus"] = external_status + if priority is not None: + payload["priority"] = priority if attributes: payload["attributes"] = attributes if tags: @@ -1080,6 +1126,7 @@ def create_text_task( file_path: str, status: str = None, external_status: str = None, + priority: Priority = None, annotations: list = [], tags: list = [], **kwargs, @@ -1093,6 +1140,12 @@ def create_text_task( status can be 'registered', 'completed', 'skipped', 'reviewed', 'sent_back', 'approved', 'declined' (Optional). external_status can be 'registered', 'completed', 'skipped', 'reviewed', + priority is the priority of the task (default: none) (Optional). + Set one of the numbers corresponding to: + none = 0, + low = 10, + medium = 20, + high = 30, 'sent_back', 'approved', 'declined', 'customer_declined' (Optional). annotations is a list of annotation to be set in advance (Optional). tags is a list of tag to be set in advance (Optional). @@ -1115,6 +1168,8 @@ def create_text_task( payload["status"] = status if external_status: payload["externalStatus"] = external_status + if priority is not None: + payload["priority"] = priority if annotations: for annotation in annotations: annotation["content"] = name @@ -1133,6 +1188,7 @@ def create_text_classification_task( file_path: str, status: str = None, external_status: str = None, + priority: Priority = None, attributes: list = [], tags: list = [], **kwargs, @@ -1146,6 +1202,12 @@ def create_text_classification_task( status can be 'registered', 'completed', 'skipped', 'reviewed', 'sent_back', 'approved', 'declined' (Optional). external_status can be 'registered', 'completed', 'skipped', 'reviewed', + priority is the priority of the task (default: none) (Optional). + Set one of the numbers corresponding to: + none = 0, + low = 10, + medium = 20, + high = 30, 'sent_back', 'approved', 'declined', 'customer_declined' (Optional). attributes is a list of attribute to be set in advance (Optional). tags is a list of tag to be set in advance (Optional). @@ -1168,6 +1230,8 @@ def create_text_classification_task( payload["status"] = status if external_status: payload["externalStatus"] = external_status + if priority is not None: + payload["priority"] = priority if attributes: payload["attributes"] = attributes if tags: @@ -1184,6 +1248,7 @@ def create_audio_task( file_path: str, status: str = None, external_status: str = None, + priority: Priority = None, annotations: list = [], tags: list = [], **kwargs, @@ -1197,6 +1262,12 @@ def create_audio_task( status can be 'registered', 'completed', 'skipped', 'reviewed', 'sent_back', 'approved', 'declined' (Optional). external_status can be 'registered', 'completed', 'skipped', 'reviewed', + priority is the priority of the task (default: none) (Optional). + Set one of the numbers corresponding to: + none = 0, + low = 10, + medium = 20, + high = 30, 'sent_back', 'approved', 'declined', 'customer_declined' (Optional). annotations is a list of annotation to be set in advance (Optional). tags is a list of tag to be set in advance (Optional). @@ -1223,6 +1294,8 @@ def create_audio_task( payload["status"] = status if external_status: payload["externalStatus"] = external_status + if priority is not None: + payload["priority"] = priority if annotations: for annotation in annotations: annotation["content"] = name @@ -1241,6 +1314,7 @@ def create_audio_classification_task( file_path: str, status: str = None, external_status: str = None, + priority: Priority = None, attributes: list = [], tags: list = [], **kwargs, @@ -1254,6 +1328,12 @@ def create_audio_classification_task( status can be 'registered', 'completed', 'skipped', 'reviewed', 'sent_back', 'approved', 'declined' (Optional). external_status can be 'registered', 'completed', 'skipped', 'reviewed', + priority is the priority of the task (default: none) (Optional). + Set one of the numbers corresponding to: + none = 0, + low = 10, + medium = 20, + high = 30, 'sent_back', 'approved', 'declined', 'customer_declined' (Optional). attributes is a list of attribute to be set in advance (Optional). tags is a list of tag to be set in advance (Optional). @@ -1280,6 +1360,8 @@ def create_audio_classification_task( payload["status"] = status if external_status: payload["externalStatus"] = external_status + if priority is not None: + payload["priority"] = priority if attributes: payload["attributes"] = attributes if tags: @@ -1296,6 +1378,7 @@ def create_pcd_task( file_path: str, status: str = None, external_status: str = None, + priority: Priority = None, annotations: list = [], tags: list = [], **kwargs, @@ -1309,6 +1392,12 @@ def create_pcd_task( status can be 'registered', 'completed', 'skipped', 'reviewed', 'sent_back', 'approved', 'declined' (Optional). external_status can be 'registered', 'completed', 'skipped', 'reviewed', + priority is the priority of the task (default: none) (Optional). + Set one of the numbers corresponding to: + none = 0, + low = 10, + medium = 20, + high = 30, 'sent_back', 'approved', 'declined', 'customer_declined' (Optional). annotations is a list of annotation to be set in advance (Optional). tags is a list of tag to be set in advance (Optional). @@ -1331,6 +1420,8 @@ def create_pcd_task( payload["status"] = status if external_status: payload["externalStatus"] = external_status + if priority is not None: + payload["priority"] = priority if annotations: for annotation in annotations: annotation["content"] = name @@ -1349,6 +1440,7 @@ def create_sequential_pcd_task( folder_path: str, status: str = None, external_status: str = None, + priority: Priority = None, annotations: list = [], tags: list = [], **kwargs, @@ -1364,6 +1456,12 @@ def create_sequential_pcd_task( status can be 'registered', 'completed', 'skipped', 'reviewed', 'sent_back', 'approved', 'declined' (Optional). external_status can be 'registered', 'completed', 'skipped', 'reviewed', + priority is the priority of the task (default: none) (Optional). + Set one of the numbers corresponding to: + none = 0, + low = 10, + medium = 20, + high = 30, 'sent_back', 'approved', 'declined', 'customer_declined' (Optional). annotations is a list of annotation to be set in advance (Optional). tags is a list of tag to be set in advance (Optional). @@ -1414,6 +1512,8 @@ def create_sequential_pcd_task( payload["status"] = status if external_status: payload["externalStatus"] = external_status + if priority is not None: + payload["priority"] = priority if annotations: payload["annotations"] = annotations if tags: @@ -1430,6 +1530,7 @@ def update_task( task_id: str, status: str = None, external_status: str = None, + priority: Priority = None, tags: list = [], **kwargs, ) -> str: @@ -1440,6 +1541,12 @@ def update_task( status can be 'registered', 'completed', 'skipped', 'reviewed', 'sent_back', 'approved', 'declined' (Optional). external_status can be 'registered', 'completed', 'skipped', 'reviewed', + priority is the priority of the task (default: none) (Optional). + Set one of the numbers corresponding to: + none = 0, + low = 10, + medium = 20, + high = 30, 'sent_back', 'approved', 'declined', 'customer_declined'. (Optional) tags is a list of tag to be set (Optional). assignee is slug of assigned user (Optional). @@ -1455,6 +1562,8 @@ def update_task( payload["status"] = status if external_status: payload["externalStatus"] = external_status + if priority is not None: + payload["priority"] = priority if tags: payload["tags"] = tags @@ -1467,6 +1576,7 @@ def update_image_task( task_id: str, status: str = None, external_status: str = None, + priority: Priority = None, tags: list = [], annotations: List[dict] = [], **kwargs, @@ -1478,6 +1588,12 @@ def update_image_task( status can be 'registered', 'completed', 'skipped', 'reviewed', 'sent_back', 'approved', 'declined' (Optional). external_status can be 'registered', 'completed', 'skipped', 'reviewed', + priority is the priority of the task (default: none) (Optional). + Set one of the numbers corresponding to: + none = 0, + low = 10, + medium = 20, + high = 30, 'sent_back', 'approved', 'declined', 'customer_declined'. (Optional) tags is a list of tag to be set (Optional). annotations is a list of annotation to be set (Optional). @@ -1494,6 +1610,8 @@ def update_image_task( payload["status"] = status if external_status: payload["externalStatus"] = external_status + if priority is not None: + payload["priority"] = priority if tags: payload["tags"] = tags if annotations: @@ -1512,6 +1630,7 @@ def update_image_classification_task( task_id: str, status: str = None, external_status: str = None, + priority: Priority = None, attributes: list = [], tags: list = [], **kwargs, @@ -1523,6 +1642,12 @@ def update_image_classification_task( status can be 'registered', 'completed', 'skipped', 'reviewed', 'sent_back', 'approved', 'declined' (Optional). external_status can be 'registered', 'completed', 'skipped', 'reviewed', + priority is the priority of the task (default: none) (Optional). + Set one of the numbers corresponding to: + none = 0, + low = 10, + medium = 20, + high = 30, 'sent_back', 'approved', 'declined', 'customer_declined' (Optional). attributes is a list of attribute to be set in advance (Optional). tags is a list of tag to be set in advance (Optional). @@ -1539,6 +1664,8 @@ def update_image_classification_task( payload["status"] = status if external_status: payload["externalStatus"] = external_status + if priority is not None: + payload["priority"] = priority if attributes: payload["attributes"] = attributes if tags: @@ -1553,6 +1680,7 @@ def update_multi_image_task( task_id: str, status: str = None, external_status: str = None, + priority: Priority = None, tags: list = [], annotations: List[dict] = [], **kwargs, @@ -1564,6 +1692,12 @@ def update_multi_image_task( status can be 'registered', 'completed', 'skipped', 'reviewed', 'sent_back', 'approved', 'declined' (Optional). external_status can be 'registered', 'completed', 'skipped', 'reviewed', + priority is the priority of the task (default: none) (Optional). + Set one of the numbers corresponding to: + none = 0, + low = 10, + medium = 20, + high = 30, 'sent_back', 'approved', 'declined', 'customer_declined'. (Optional) tags is a list of tag to be set (Optional). annotations is a list of annotation to be set (Optional). @@ -1580,6 +1714,8 @@ def update_multi_image_task( payload["status"] = status if external_status: payload["externalStatus"] = external_status + if priority is not None: + payload["priority"] = priority if tags: payload["tags"] = tags if annotations: @@ -1594,6 +1730,7 @@ def update_video_task( task_id: str, status: str = None, external_status: str = None, + priority: Priority = None, tags: list = [], annotations: List[dict] = [], **kwargs, @@ -1605,6 +1742,12 @@ def update_video_task( status can be 'registered', 'completed', 'skipped', 'reviewed', 'sent_back', 'approved', 'declined' (Optional). external_status can be 'registered', 'completed', 'skipped', 'reviewed', + priority is the priority of the task (default: none) (Optional). + Set one of the numbers corresponding to: + none = 0, + low = 10, + medium = 20, + high = 30, 'sent_back', 'approved', 'declined', 'customer_declined' (Optional). tags is a list of tag to be set (Optional). annotations is a list of annotation to be set (Optional). @@ -1621,6 +1764,8 @@ def update_video_task( payload["status"] = status if external_status: payload["externalStatus"] = external_status + if priority is not None: + payload["priority"] = priority if tags: payload["tags"] = tags if annotations: @@ -1637,6 +1782,7 @@ def update_video_classification_task( task_id: str, status: str = None, external_status: str = None, + priority: Priority = None, attributes: list = [], tags: list = [], **kwargs, @@ -1648,6 +1794,12 @@ def update_video_classification_task( status can be 'registered', 'completed', 'skipped', 'reviewed', 'sent_back', 'approved', 'declined' (Optional). external_status can be 'registered', 'completed', 'skipped', 'reviewed', + priority is the priority of the task (default: none) (Optional). + Set one of the numbers corresponding to: + none = 0, + low = 10, + medium = 20, + high = 30, 'sent_back', 'approved', 'declined', 'customer_declined' (Optional). attributes is a list of attribute to be set in advance (Optional). tags is a list of tag to be set in advance (Optional). @@ -1664,6 +1816,8 @@ def update_video_classification_task( payload["status"] = status if external_status: payload["externalStatus"] = external_status + if priority is not None: + payload["priority"] = priority if attributes: payload["attributes"] = attributes if tags: @@ -1678,6 +1832,7 @@ def update_text_task( task_id: str, status: str = None, external_status: str = None, + priority: Priority = None, tags: list = [], annotations: List[dict] = [], **kwargs, @@ -1689,6 +1844,12 @@ def update_text_task( status can be 'registered', 'completed', 'skipped', 'reviewed', 'sent_back', 'approved', 'declined' (Optional). external_status can be 'registered', 'completed', 'skipped', 'reviewed', + priority is the priority of the task (default: none) (Optional). + Set one of the numbers corresponding to: + none = 0, + low = 10, + medium = 20, + high = 30, 'sent_back', 'approved', 'declined', 'customer_declined' (Optional). tags is a list of tag to be set (Optional). annotations is a list of annotation to be set (Optional). @@ -1705,6 +1866,8 @@ def update_text_task( payload["status"] = status if external_status: payload["externalStatus"] = external_status + if priority is not None: + payload["priority"] = priority if tags: payload["tags"] = tags if annotations: @@ -1721,6 +1884,7 @@ def update_text_classification_task( task_id: str, status: str = None, external_status: str = None, + priority: Priority = None, attributes: list = [], tags: list = [], **kwargs, @@ -1732,6 +1896,12 @@ def update_text_classification_task( status can be 'registered', 'completed', 'skipped', 'reviewed', 'sent_back', 'approved', 'declined' (Optional). external_status can be 'registered', 'completed', 'skipped', 'reviewed', + priority is the priority of the task (default: none) (Optional). + Set one of the numbers corresponding to: + none = 0, + low = 10, + medium = 20, + high = 30, 'sent_back', 'approved', 'declined', 'customer_declined' (Optional). attributes is a list of attribute to be set in advance (Optional). tags is a list of tag to be set in advance (Optional). @@ -1748,6 +1918,8 @@ def update_text_classification_task( payload["status"] = status if external_status: payload["externalStatus"] = external_status + if priority is not None: + payload["priority"] = priority if attributes: payload["attributes"] = attributes if tags: @@ -1762,6 +1934,7 @@ def update_audio_task( task_id: str, status: str = None, external_status: str = None, + priority: Priority = None, tags: list = [], annotations: List[dict] = [], **kwargs, @@ -1773,6 +1946,12 @@ def update_audio_task( status can be 'registered', 'completed', 'skipped', 'reviewed', 'sent_back', 'approved', 'declined' (Optional). external_status can be 'registered', 'completed', 'skipped', 'reviewed', + priority is the priority of the task (default: none) (Optional). + Set one of the numbers corresponding to: + none = 0, + low = 10, + medium = 20, + high = 30, 'sent_back', 'approved', 'declined', 'customer_declined' (Optional). tags is a list of tag to be set (Optional). annotations is a list of annotation to be set (Optional). @@ -1789,6 +1968,8 @@ def update_audio_task( payload["status"] = status if external_status: payload["externalStatus"] = external_status + if priority is not None: + payload["priority"] = priority if tags: payload["tags"] = tags if annotations: @@ -1805,6 +1986,7 @@ def update_audio_classification_task( task_id: str, status: str = None, external_status: str = None, + priority: Priority = None, attributes: list = [], tags: list = [], **kwargs, @@ -1816,6 +1998,12 @@ def update_audio_classification_task( status can be 'registered', 'completed', 'skipped', 'reviewed', 'sent_back', 'approved', 'declined' (Optional). external_status can be 'registered', 'completed', 'skipped', 'reviewed', + priority is the priority of the task (default: none) (Optional). + Set one of the numbers corresponding to: + none = 0, + low = 10, + medium = 20, + high = 30, 'sent_back', 'approved', 'declined', 'customer_declined' (Optional). attributes is a list of attribute to be set in advance (Optional). tags is a list of tag to be set in advance (Optional). @@ -1832,6 +2020,8 @@ def update_audio_classification_task( payload["status"] = status if external_status: payload["externalStatus"] = external_status + if priority is not None: + payload["priority"] = priority if attributes: payload["attributes"] = attributes if tags: @@ -1846,6 +2036,7 @@ def update_pcd_task( task_id: str, status: str = None, external_status: str = None, + priority: Priority = None, tags: list = [], annotations: List[dict] = [], **kwargs, @@ -1857,6 +2048,12 @@ def update_pcd_task( status can be 'registered', 'completed', 'skipped', 'reviewed', 'sent_back', 'approved', 'declined' (Optional). external_status can be 'registered', 'completed', 'skipped', 'reviewed', + priority is the priority of the task (default: none) (Optional). + Set one of the numbers corresponding to: + none = 0, + low = 10, + medium = 20, + high = 30, 'sent_back', 'approved', 'declined', 'customer_declined'. (Optional) tags is a list of tag to be set (Optional). annotations is a list of annotation to be set (Optional). @@ -1873,6 +2070,8 @@ def update_pcd_task( payload["status"] = status if external_status: payload["externalStatus"] = external_status + if priority is not None: + payload["priority"] = priority if tags: payload["tags"] = tags if annotations: @@ -1891,6 +2090,7 @@ def update_sequential_pcd_task( task_id: str, status: str = None, external_status: str = None, + priority: Priority = None, tags: list = [], annotations: List[dict] = [], **kwargs, @@ -1902,6 +2102,12 @@ def update_sequential_pcd_task( status can be 'registered', 'completed', 'skipped', 'reviewed', 'sent_back', 'approved', 'declined' (Optional). external_status can be 'registered', 'completed', 'skipped', 'reviewed', + priority is the priority of the task (default: none) (Optional). + Set one of the numbers corresponding to: + none = 0, + low = 10, + medium = 20, + high = 30, 'sent_back', 'approved', 'declined', 'customer_declined'. (Optional) tags is a list of tag to be set (Optional). annotations is a list of annotation to be set (Optional). @@ -1918,6 +2124,8 @@ def update_sequential_pcd_task( payload["status"] = status if external_status: payload["externalStatus"] = external_status + if priority is not None: + payload["priority"] = priority if tags: payload["tags"] = tags if annotations: diff --git a/fastlabel/const.py b/fastlabel/const.py index 9e509a1..905ff88 100644 --- a/fastlabel/const.py +++ b/fastlabel/const.py @@ -228,3 +228,10 @@ class AnnotationType(Enum): segmentation = "segmentation" classification = "classification" pose_estimation = "pose_estimation" + +class Priority(Enum): + none = 0 + low = 10 + medium = 20 + high = 30 +