Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
199 changes: 197 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,25 @@

_If you are using FastLabel prototype, please install version 0.2.2._

## Table of Contents

- [Installation](#installation)
- [Usage](#usage)
- [Limitation](#limitation)
- [Task](#task)
- [Image](#image)
- [Image Classification](#image-classification)
- [Multi Image](#multi-image)
- [Video](#video)
- [Common](#common)
- [Annotation](#annotation)
- [Converter](#converter)
- [COCO](#coco)

## Installation

```bash
$ pip install --upgrade fastlabel
pip install --upgrade fastlabel
```

> Python version 3.7 or greater is required
Expand All @@ -25,7 +40,7 @@ import fastlabel
client = fastlabel.Client()
```

## Limitation
### Limitation

API 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.

Expand Down Expand Up @@ -90,6 +105,12 @@ task_id = client.create_image_task(
task = client.find_image_task(task_id="YOUR_TASK_ID")
```

- Find a single task by name.

```python
tasks = client.find_image_task_by_name(project="YOUR_PROJECT_SLUG", task_name="YOUR_TASK_NAME")
```

#### Get Tasks

- Get tasks. (Up to 1000 tasks)
Expand Down Expand Up @@ -466,6 +487,180 @@ task_id = client.update_task(
client.delete_task(task_id="YOUR_TASK_ID")
```

#### Get Tasks Id and Name map

```python
map = client.get_task_id_name_map(project="YOUR_PROJECT_SLUG")
```

## Annotation

### Create Annotaion

- Create a new annotation.

```python
annotation_id = client.create_annotation(
project="YOUR_PROJECT_SLUG", type="bbox", value="cat", title="Cat", color="#FF0000")
```

- Create a new annotation with attributes.

```python
attributes = [
{
"type": "text",
"name": "Kind",
"key": "kind"
},
{
"type": "select",
"name": "Size",
"key": "size",
"options": [ # select, radio and checkbox type requires options
{
"title": "Large",
"value": "large"
},
{
"title": "Small",
"value": "small"
},
]
},
]
annotation_id = client.create_annotation(
project="YOUR_PROJECT_SLUG", type="bbox", value="cat", title="Cat", color="#FF0000", attributes=attributes)
```

- Create a new classification annotation.

```python
annotation_id = client.create_classification_annotation(
project="YOUR_PROJECT_SLUG", attributes=attributes)
```

### Find Annotation

- Find an annotation.

```python
annotaion = client.find_annotation(annotation_id="YOUR_ANNOTATIPN_ID")
```

- Find an annotation by value.

```python
annotaion = client.find_annotation_by_value(project="YOUR_PROJECT_SLUG", value="cat")
```

- Find an annotation by value in classification project.

```python
annotaion = client.find_annotation_by_value(
project="YOUR_PROJECT_SLUG", value="classification") # "classification" is fixed value
```

### Get Annotations

- Get annotations. (Up to 1000 annotations)

```python
annotatios = client.get_annotations(project="YOUR_PROJECT_SLUG")
```

### Response

- Example of an annotation object

```python
{
"id": "YOUR_ANNOTATION_ID",
"type": "bbox",
"value": "cat",
"title": "Cat",
"color": "#FF0000",
"attributes": [
{
"id": "YOUR_ATTRIBUTE_ID",
"key": "kind",
"name": "Kind",
"options": [],
"type": "text",
"value": ""
},
{
"id": "YOUR_ATTRIBUTE_ID",
"key": "size",
"name": "Size",
"options": [
{"title": "Large", "value": "large"},
{"title": "Small", "value": "small"}
],
"type": "select",
"value": ""
}
],
"createdAt": "2021-05-25T05:36:50.459Z",
"updatedAt": "2021-05-25T05:36:50.459Z"
}
```

### Update Annotation

- Update an annotation.

```python
annotation_id = client.update_annotation(
annotation_id="YOUR_ANNOTATION_ID", value="cat2", title="Cat2", color="#FF0000")
```

- Update an annotation with attributes.

```python
attributes = [
{
"id": "YOUR_ATTRIBUTE_ID", # check by sdk get methods
"type": "text",
"name": "Kind2",
"key": "kind2"
},
{
"id": "YOUR_ATTRIBUTE_ID",
"type": "select",
"name": "Size2",
"key": "size2",
"options": [
{
"title": "Large2",
"value": "large2"
},
{
"title": "Small2",
"value": "small2"
},
]
},
]
annotation_id = client.update_annotation(
annotation_id="YOUR_ANNOTATION_ID", value="cat2", title="Cat2", color="#FF0000", attributes=attributes)
```

- Update a classification annotation.

```python
annotation_id = client.update_classification_annotation(
project="YOUR_PROJECT_SLUG", attributes=attributes)
```

### Delete Annotation

- Delete an annotation.

```python
client.delete_annotation(annotation_id="YOUR_ANNOTATIPN_ID")
```

## Converter

### COCO
Expand Down
Loading