Skip to content

Commit 1175b77

Browse files
authored
Merge pull request #114 from fastlabel/enhance/1099-split-image
integrate splited image
2 parents 2e4f596 + e944cad commit 1175b77

File tree

2 files changed

+75
-0
lines changed

2 files changed

+75
-0
lines changed

README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,63 @@ Example when the project type is Image - Pose Estimation
305305
}
306306
```
307307

308+
#### Integrate Task
309+
310+
This function is alpha version. It is subject to major changes in the future.
311+
312+
Integration is possible only when tasks are registered from the objects divided by the dataset.
313+
Only bbox and polygon annotation types are supported.
314+
315+
In the case of a task divided under the following conditions.
316+
317+
dataset slug: image
318+
object name: cat.jpg
319+
split count: 3×3
320+
321+
Objects are registered in the data set in the following form.
322+
323+
- image/cat/1.jpg
324+
- image/cat/2.jpg
325+
- image/cat/3.jpg
326+
(omit)
327+
- image/cat/9.jpg
328+
329+
330+
The annotations at the edges of the image are combined. However, annotations with a maximum length of 300px may not work.
331+
332+
In this case, SPLIT_IMAGE_TASK_NAME_PREFIX specifies `image/cat`.
333+
334+
```python
335+
task = client.find_integrated_image_task_by_prefix(
336+
project="YOUR_PROJECT_SLUG",
337+
prefix="SPLIT_IMAGE_TASK_NAME_PREFIX",
338+
)
339+
```
340+
341+
##### Response
342+
343+
Example of a integrated image task object
344+
345+
```python
346+
{
347+
'groupId': 'eda3ba5b-082c-4813-ad6c-0479b72a27d5',
348+
'name': 'image/cat.jpg',
349+
"annotations": [
350+
{
351+
"attributes": [],
352+
"color": "#b36d18",
353+
"confidenceScore"; -1,
354+
"keypoints": [],
355+
"points": [200,200,300,400],
356+
"rotation": 0,
357+
"title": "Bird",
358+
"type": "polygon",
359+
"value": "bird"
360+
}
361+
],
362+
}
363+
```
364+
308365
### Image Classification
309366

310367
Supported following project types:
@@ -1110,6 +1167,8 @@ Example of a single audio task object
11101167

11111168
#### Integrate Task
11121169

1170+
This function is alpha version. It is subject to major changes in the future.
1171+
11131172
Integration is possible only when tasks are registered from the objects divided by the dataset.
11141173

11151174
In the case of a task divided under the following conditions.

fastlabel/__init__.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,6 +1575,22 @@ def delete_task(self, task_id: str) -> None:
15751575

15761576
# Integrate Task
15771577

1578+
def find_integrated_image_task_by_prefix(
1579+
self,
1580+
project: str,
1581+
prefix: str,
1582+
) -> dict:
1583+
"""
1584+
Returns a integrate image task.
1585+
project is slug of your project (Required).
1586+
prefix is a prefix of task name (Required).
1587+
"""
1588+
endpoint = "tasks/integrate/images"
1589+
params = {"project": project, "prefix": prefix}
1590+
1591+
return self.api.get_request(endpoint, params=params)
1592+
1593+
15781594
def find_integrated_audio_task_by_prefix(
15791595
self,
15801596
project: str,

0 commit comments

Comments
 (0)