Skip to content

Commit f906ca7

Browse files
Merge pull request #160 from fastlabel/migration-sequential
Migration sequential
2 parents e4683dc + 4211dac commit f906ca7

File tree

2 files changed

+34
-35
lines changed

2 files changed

+34
-35
lines changed

README.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ _If you are using FastLabel prototype, please install version 0.2.2._
1010
- [Task](#task)
1111
- [Image](#image)
1212
- [Image Classification](#image-classification)
13-
- [Multi Image](#multi-image)
13+
- [Sequential Image](#sequential-image)
1414
- [Video](#video)
1515
- [Video Classification](#video-classification)
1616
- [Text](#text)
@@ -122,7 +122,6 @@ task_id = client.create_image_task(
122122

123123
- You can upload up to a size of 20 MB.
124124

125-
126125
#### Create Integrated Image Task
127126

128127
Create a new task by integrated image.
@@ -142,7 +141,7 @@ Create a new task with pre-defined annotations. (Class should be configured on y
142141
task_id = client.create_image_task(
143142
project="YOUR_PROJECT_SLUG",
144143
file_path="<integrated-storage-dir>/sample.jpg",
145-
storage_type="gcp",
144+
storage_type="gcp",
146145
annotations=[{
147146
"type": "bbox",
148147
"value": "annotation-value",
@@ -166,7 +165,6 @@ task_id = client.create_image_task(
166165

167166
- You can upload up to a size of 20 MB.
168167

169-
170168
#### Find Task
171169

172170
Find a single task.
@@ -539,22 +537,22 @@ Example of a single image classification task object
539537
}
540538
```
541539

542-
### Multi Image
540+
### Sequential Image
543541

544542
Supported following project types:
545543

546-
- Multi Image - Bounding Box
547-
- Multi Image - Polygon
548-
- Multi Image - Keypoint
549-
- Multi Image - Line
550-
- Multi Image - Segmentation
544+
- Sequential Image - Bounding Box
545+
- Sequential Image - Polygon
546+
- Sequential Image - Keypoint
547+
- Sequential Image - Line
548+
- Sequential Image - Segmentation
551549

552550
#### Create Task
553551

554552
Create a new task.
555553

556554
```python
557-
task = client.create_multi_image_task(
555+
task = client.create_sequential_image_task(
558556
project="YOUR_PROJECT_SLUG",
559557
name="sample",
560558
folder_path="./sample",
@@ -596,29 +594,29 @@ task = client.create_multi_image_task(
596594
Find a single task.
597595

598596
```python
599-
task = client.find_multi_image_task(task_id="YOUR_TASK_ID")
597+
task = client.find_sequential_image_task(task_id="YOUR_TASK_ID")
600598
```
601599

602600
Find a single task by name.
603601

604602
```python
605-
tasks = client.find_multi_image_task_by_name(project="YOUR_PROJECT_SLUG", task_name="YOUR_TASK_NAME")
603+
tasks = client.find_sequential_image_task_by_name(project="YOUR_PROJECT_SLUG", task_name="YOUR_TASK_NAME")
606604
```
607605

608606
#### Get Tasks
609607

610608
Get tasks.
611609

612610
```python
613-
tasks = client.get_multi_image_tasks(project="YOUR_PROJECT_SLUG")
611+
tasks = client.get_sequential_image_tasks(project="YOUR_PROJECT_SLUG")
614612
```
615613

616614
#### Update Task
617615

618616
Update a single task.
619617

620618
```python
621-
task_id = client.update_multi_image_task(
619+
task_id = client.update_sequential_image_task(
622620
task_id="YOUR_TASK_ID",
623621
status="approved",
624622
assignee="USER_SLUG",
@@ -1950,6 +1948,7 @@ id_name_map = client.get_task_id_name_map(project="YOUR_PROJECT_SLUG")
19501948
```
19511949

19521950
#### Count Task
1951+
19531952
```python
19541953
task_count = client.count_tasks(
19551954
project="YOUR_PROJECT_SLUG",

fastlabel/__init__.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -83,21 +83,21 @@ def find_image_classification_task_by_name(
8383
return None
8484
return tasks[0]
8585

86-
def find_multi_image_task(self, task_id: str) -> dict:
86+
def find_sequential_image_task(self, task_id: str) -> dict:
8787
"""
88-
Find a single multi image task.
88+
Find a single sequential image task.
8989
"""
90-
endpoint = "tasks/multi-image/" + task_id
90+
endpoint = "tasks/sequential-image/" + task_id
9191
return self.api.get_request(endpoint)
9292

93-
def find_multi_image_task_by_name(self, project: str, task_name: str) -> dict:
93+
def find_sequential_image_task_by_name(self, project: str, task_name: str) -> dict:
9494
"""
95-
Find a single multi image task by name.
95+
Find a single sequential image task by name.
9696
9797
project is slug of your project (Required).
9898
task_name is a task name (Required).
9999
"""
100-
tasks = self.get_multi_image_tasks(project=project, task_name=task_name)
100+
tasks = self.get_sequential_image_tasks(project=project, task_name=task_name)
101101
if not tasks:
102102
return None
103103
return tasks[0]
@@ -406,7 +406,7 @@ def get_image_classification_tasks(
406406
params["limit"] = limit
407407
return self.api.get_request(endpoint, params=params)
408408

409-
def get_multi_image_tasks(
409+
def get_sequential_image_tasks(
410410
self,
411411
project: str,
412412
status: str = None,
@@ -417,7 +417,7 @@ def get_multi_image_tasks(
417417
limit: int = 10,
418418
) -> list:
419419
"""
420-
Returns a list of multi image tasks.
420+
Returns a list of sequential image tasks.
421421
Returns up to 10 at a time, to get more, set offset as the starting position
422422
to fetch.
423423
@@ -434,7 +434,7 @@ def get_multi_image_tasks(
434434
raise FastLabelInvalidException(
435435
"Limit must be less than or equal to 10.", 422
436436
)
437-
endpoint = "tasks/multi-image"
437+
endpoint = "tasks/sequential-image"
438438
params = {"project": project}
439439
if status:
440440
params["status"] = status
@@ -1054,7 +1054,7 @@ def create_image_classification_task(
10541054

10551055
return self.api.post_request(endpoint, payload=payload)
10561056

1057-
def create_multi_image_task(
1057+
def create_sequential_image_task(
10581058
self,
10591059
project: str,
10601060
name: str,
@@ -1067,7 +1067,7 @@ def create_multi_image_task(
10671067
**kwargs,
10681068
) -> str:
10691069
"""
1070-
Create a single multi image task.
1070+
Create a single sequential image task.
10711071
10721072
project is slug of your project (Required).
10731073
name is an unique identifier of task in your project (Required).
@@ -1096,7 +1096,7 @@ def create_multi_image_task(
10961096
if not os.path.isdir(folder_path):
10971097
raise FastLabelInvalidException("Folder does not exist.", 422)
10981098

1099-
endpoint = "tasks/multi-image"
1099+
endpoint = "tasks/sequential-image"
11001100
file_paths = glob.glob(os.path.join(folder_path, "*"))
11011101
if not file_paths:
11021102
raise FastLabelInvalidException("Folder does not have any file.", 422)
@@ -1878,7 +1878,7 @@ def update_image_classification_task(
18781878

18791879
return self.api.put_request(endpoint, payload=payload)
18801880

1881-
def update_multi_image_task(
1881+
def update_sequential_image_task(
18821882
self,
18831883
task_id: str,
18841884
status: str = None,
@@ -1889,7 +1889,7 @@ def update_multi_image_task(
18891889
**kwargs,
18901890
) -> str:
18911891
"""
1892-
Update a multi image task.
1892+
Update a sequential image task.
18931893
18941894
task_id is an id of the task (Required).
18951895
status can be 'registered', 'completed', 'skipped', 'reviewed', 'sent_back',
@@ -1911,7 +1911,7 @@ def update_multi_image_task(
19111911
external_reviewer is slug of external review user (Optional).
19121912
external_approver is slug of external approve user (Optional).
19131913
"""
1914-
endpoint = "tasks/multi-image/" + task_id
1914+
endpoint = "tasks/sequential-image/" + task_id
19151915
payload = {}
19161916
if status:
19171917
payload["status"] = status
@@ -3174,8 +3174,8 @@ def __create_image_with_annotation(self, img_file_path_task):
31743174
for points in region:
31753175
if count == 0:
31763176
cv_draw_points = self.__get_cv_draw_points(points)
3177-
# For diagonal segmentation points, fillPoly cannot rendering cv_drawpoints, so convert
3178-
# shape. When multiimage project can use only pixcel mode, remove it
3177+
# For diagonal segmentation points, fillPoly cannot rendering cv_draw_points, so convert
3178+
# shape. When sequential image project can use only pixel mode, remove it
31793179
converted_points = (
31803180
np.array(cv_draw_points)
31813181
.reshape((-1, 1, 2))
@@ -3639,9 +3639,9 @@ def create_project(
36393639
Create a project.
36403640
36413641
type can be 'image_bbox', 'image_polygon', 'image_keypoint', 'image_line',
3642-
'image_segmentation', 'image_classification', 'image_all', 'multi_image_bbox',
3643-
'multi_image_polygon', 'multi_image_keypoint', 'multi_image_line',
3644-
'multi_image_segmentation', 'video_bbox',
3642+
'image_segmentation', 'image_classification', 'image_all', 'sequential_image_bbox',
3643+
'sequential_image_polygon', 'sequential_image_keypoint', 'sequential_image_line',
3644+
'sequential_image_segmentation', 'video_bbox',
36453645
'video_single_classification' (Required).
36463646
name is name of your project (Required).
36473647
slug is slug of your project (Required).

0 commit comments

Comments
 (0)