From a8cf600300801b14be58bb2fb67f7a4936f190d5 Mon Sep 17 00:00:00 2001 From: rikunosuke Date: Tue, 16 Apr 2024 07:28:48 +0900 Subject: [PATCH] feature: enable to update task relations --- README.md | 11 +++++++++++ fastlabel/__init__.py | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/README.md b/README.md index fb16d28..822b329 100644 --- a/README.md +++ b/README.md @@ -244,6 +244,17 @@ task_id = client.update_image_task( ] } ], + # pass annotation indexes to update + relations=[ + { + "startIndex": 1, + "endIndex": 0, + }, + { + "startIndex": 2, + "endIndex": 0 + } + ] ) ``` diff --git a/fastlabel/__init__.py b/fastlabel/__init__.py index fc0acda..5adb4b1 100644 --- a/fastlabel/__init__.py +++ b/fastlabel/__init__.py @@ -1870,6 +1870,7 @@ def update_image_task( priority: Priority = None, tags: list = [], annotations: List[dict] = [], + relations: Optional[List[dict]] = None, **kwargs, ) -> str: """ @@ -1888,6 +1889,7 @@ def update_image_task( '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). + relations is a list of annotation relations to be set (Optional). assignee is slug of assigned user (Optional). reviewer is slug of review user (Optional). approver is slug of approve user (Optional). @@ -1911,6 +1913,8 @@ def update_image_task( # the content will be filled on the server side. annotation["content"] = "" payload["annotations"] = delete_extra_annotations_parameter(annotations) + if relations: + payload["relations"] = relations self.__fill_assign_users(payload, **kwargs)