22
33_ If you are using FastLabel prototype, please install version 0.2.2._
44
5+ ## Table of Contents
6+
7+ - [ Installation] ( #installation )
8+ - [ Usage] ( #usage )
9+ - [ Limitation] ( #limitation )
10+ - [ Task] ( #task )
11+ - [ Image] ( #image )
12+ - [ Image Classification] ( #image-classification )
13+ - [ Multi Image] ( #multi-image )
14+ - [ Video] ( #video )
15+ - [ Common] ( #common )
16+ - [ Annotation] ( #annotation )
17+ - [ Converter] ( #converter )
18+ - [ COCO] ( #coco )
19+
520## Installation
621
722``` bash
8- $ pip install --upgrade fastlabel
23+ pip install --upgrade fastlabel
924```
1025
1126> Python version 3.7 or greater is required
@@ -25,7 +40,7 @@ import fastlabel
2540client = fastlabel.Client()
2641```
2742
28- ## Limitation
43+ ### Limitation
2944
3045API is allowed to call 10000 times per 10 minutes. If you create/delete a large size of tasks, please wait a second for every requests.
3146
@@ -90,6 +105,12 @@ task_id = client.create_image_task(
90105task = client.find_image_task(task_id = " YOUR_TASK_ID" )
91106```
92107
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+
93114#### Get Tasks
94115
95116- Get tasks. (Up to 1000 tasks)
@@ -466,6 +487,180 @@ task_id = client.update_task(
466487client.delete_task(task_id = " YOUR_TASK_ID" )
467488```
468489
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+
469664## Converter
470665
471666### COCO
0 commit comments