Skip to content

Commit e82542c

Browse files
authored
Merge pull request #27 from fastlabel/0.7.1
0.7.1
2 parents eecbd4c + 4ad778c commit e82542c

File tree

7 files changed

+765
-299
lines changed

7 files changed

+765
-299
lines changed

README.md

Lines changed: 188 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@ _If you are using FastLabel prototype, please install version 0.2.2._
66

77
- [Installation](#installation)
88
- [Usage](#usage)
9-
- [Limitation](#limitation)
9+
- [Limitation](#limitation)
1010
- [Task](#task)
11-
- [Image](#image)
12-
- [Image Classification](#image-classification)
13-
- [Multi Image](#multi-image)
14-
- [Video](#video)
15-
- [Common](#common)
11+
- [Image](#image)
12+
- [Image Classification](#image-classification)
13+
- [Multi Image](#multi-image)
14+
- [Video](#video)
15+
- [Common](#common)
16+
- [Annotation](#annotation)
1617
- [Converter](#converter)
17-
- [COCO](#coco)
18+
- [COCO](#coco)
1819

1920
## Installation
2021

@@ -104,6 +105,12 @@ task_id = client.create_image_task(
104105
task = client.find_image_task(task_id="YOUR_TASK_ID")
105106
```
106107

108+
- Find a single task by name.
109+
110+
```python
111+
tasks = client.find_image_task_by_name(project="YOUR_PROJECT_SLUG", task_name="YOUR_TASK_NAME")
112+
```
113+
107114
#### Get Tasks
108115

109116
- Get tasks. (Up to 1000 tasks)
@@ -480,6 +487,180 @@ task_id = client.update_task(
480487
client.delete_task(task_id="YOUR_TASK_ID")
481488
```
482489

490+
#### Get Tasks Id and Name map
491+
492+
```python
493+
map = client.get_task_id_name_map(project="YOUR_PROJECT_SLUG")
494+
```
495+
496+
## Annotation
497+
498+
### Create Annotaion
499+
500+
- Create a new annotation.
501+
502+
```python
503+
annotation_id = client.create_annotation(
504+
project="YOUR_PROJECT_SLUG", type="bbox", value="cat", title="Cat", color="#FF0000")
505+
```
506+
507+
- Create a new annotation with attributes.
508+
509+
```python
510+
attributes = [
511+
{
512+
"type": "text",
513+
"name": "Kind",
514+
"key": "kind"
515+
},
516+
{
517+
"type": "select",
518+
"name": "Size",
519+
"key": "size",
520+
"options": [ # select, radio and checkbox type requires options
521+
{
522+
"title": "Large",
523+
"value": "large"
524+
},
525+
{
526+
"title": "Small",
527+
"value": "small"
528+
},
529+
]
530+
},
531+
]
532+
annotation_id = client.create_annotation(
533+
project="YOUR_PROJECT_SLUG", type="bbox", value="cat", title="Cat", color="#FF0000", attributes=attributes)
534+
```
535+
536+
- Create a new classification annotation.
537+
538+
```python
539+
annotation_id = client.create_classification_annotation(
540+
project="YOUR_PROJECT_SLUG", attributes=attributes)
541+
```
542+
543+
### Find Annotation
544+
545+
- Find an annotation.
546+
547+
```python
548+
annotaion = client.find_annotation(annotation_id="YOUR_ANNOTATIPN_ID")
549+
```
550+
551+
- Find an annotation by value.
552+
553+
```python
554+
annotaion = client.find_annotation_by_value(project="YOUR_PROJECT_SLUG", value="cat")
555+
```
556+
557+
- Find an annotation by value in classification project.
558+
559+
```python
560+
annotaion = client.find_annotation_by_value(
561+
project="YOUR_PROJECT_SLUG", value="classification") # "classification" is fixed value
562+
```
563+
564+
### Get Annotations
565+
566+
- Get annotations. (Up to 1000 annotations)
567+
568+
```python
569+
annotatios = client.get_annotations(project="YOUR_PROJECT_SLUG")
570+
```
571+
572+
### Response
573+
574+
- Example of an annotation object
575+
576+
```python
577+
{
578+
"id": "YOUR_ANNOTATION_ID",
579+
"type": "bbox",
580+
"value": "cat",
581+
"title": "Cat",
582+
"color": "#FF0000",
583+
"attributes": [
584+
{
585+
"id": "YOUR_ATTRIBUTE_ID",
586+
"key": "kind",
587+
"name": "Kind",
588+
"options": [],
589+
"type": "text",
590+
"value": ""
591+
},
592+
{
593+
"id": "YOUR_ATTRIBUTE_ID",
594+
"key": "size",
595+
"name": "Size",
596+
"options": [
597+
{"title": "Large", "value": "large"},
598+
{"title": "Small", "value": "small"}
599+
],
600+
"type": "select",
601+
"value": ""
602+
}
603+
],
604+
"createdAt": "2021-05-25T05:36:50.459Z",
605+
"updatedAt": "2021-05-25T05:36:50.459Z"
606+
}
607+
```
608+
609+
### Update Annotation
610+
611+
- Update an annotation.
612+
613+
```python
614+
annotation_id = client.update_annotation(
615+
annotation_id="YOUR_ANNOTATION_ID", value="cat2", title="Cat2", color="#FF0000")
616+
```
617+
618+
- Update an annotation with attributes.
619+
620+
```python
621+
attributes = [
622+
{
623+
"id": "YOUR_ATTRIBUTE_ID", # check by sdk get methods
624+
"type": "text",
625+
"name": "Kind2",
626+
"key": "kind2"
627+
},
628+
{
629+
"id": "YOUR_ATTRIBUTE_ID",
630+
"type": "select",
631+
"name": "Size2",
632+
"key": "size2",
633+
"options": [
634+
{
635+
"title": "Large2",
636+
"value": "large2"
637+
},
638+
{
639+
"title": "Small2",
640+
"value": "small2"
641+
},
642+
]
643+
},
644+
]
645+
annotation_id = client.update_annotation(
646+
annotation_id="YOUR_ANNOTATION_ID", value="cat2", title="Cat2", color="#FF0000", attributes=attributes)
647+
```
648+
649+
- Update a classification annotation.
650+
651+
```python
652+
annotation_id = client.update_classification_annotation(
653+
project="YOUR_PROJECT_SLUG", attributes=attributes)
654+
```
655+
656+
### Delete Annotation
657+
658+
- Delete an annotation.
659+
660+
```python
661+
client.delete_annotation(annotation_id="YOUR_ANNOTATIPN_ID")
662+
```
663+
483664
## Converter
484665

485666
### COCO

0 commit comments

Comments
 (0)