Skip to content

Commit 3a92399

Browse files
Merge pull request #210 from fastlabel/feature/update-task-annotation-relations
feature: enable to update task relations
2 parents babd074 + a8cf600 commit 3a92399

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,17 @@ task_id = client.update_image_task(
244244
]
245245
}
246246
],
247+
# pass annotation indexes to update
248+
relations=[
249+
{
250+
"startIndex": 1,
251+
"endIndex": 0,
252+
},
253+
{
254+
"startIndex": 2,
255+
"endIndex": 0
256+
}
257+
]
247258
)
248259
```
249260

fastlabel/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1870,6 +1870,7 @@ def update_image_task(
18701870
priority: Priority = None,
18711871
tags: list = [],
18721872
annotations: List[dict] = [],
1873+
relations: Optional[List[dict]] = None,
18731874
**kwargs,
18741875
) -> str:
18751876
"""
@@ -1888,6 +1889,7 @@ def update_image_task(
18881889
'sent_back', 'approved', 'declined', 'customer_declined'. (Optional)
18891890
tags is a list of tag to be set (Optional).
18901891
annotations is a list of annotation to be set (Optional).
1892+
relations is a list of annotation relations to be set (Optional).
18911893
assignee is slug of assigned user (Optional).
18921894
reviewer is slug of review user (Optional).
18931895
approver is slug of approve user (Optional).
@@ -1911,6 +1913,8 @@ def update_image_task(
19111913
# the content will be filled on the server side.
19121914
annotation["content"] = ""
19131915
payload["annotations"] = delete_extra_annotations_parameter(annotations)
1916+
if relations:
1917+
payload["relations"] = relations
19141918

19151919
self.__fill_assign_users(payload, **kwargs)
19161920

0 commit comments

Comments
 (0)