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
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,51 @@ task_id = client.create_video_task(
)
```

- Create a new task with pre-defined annotations. (Class should be configured on your project in advance)

```python
task_id = client.create_video_task(
project="YOUR_PROJECT_SLUG",
name="sample.mp4",
file_path="./sample.mp4",
annotations=[{
"type": "bbox",
"value": "person",
"points": {
"1": { # number of frame
"value": [
100, # top-left x
100, # top-left y
200, # bottom-right x
200 # bottom-right y
],
# Make sure to set `autogenerated` False for the first and last frame. "1" and "3" frames in this case.
# Otherwise, annotation is auto-completed for rest of frames when you edit.
"autogenerated": False
},
"2": {
"value": [
110,
110,
220,
220
],
"autogenerated": True
},
"3": {
"value": [
120,
120,
240,
240
],
"autogenerated": False
}
}
}]
)
```

#### Find Task

- Find a single task.
Expand Down
6 changes: 6 additions & 0 deletions fastlabel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ def create_video_task(
name: str,
file_path: str,
status: str = None,
annotations: list = [],
tags: list = [],
) -> str:
"""
Expand All @@ -402,6 +403,7 @@ def create_video_task(
name is an unique identifier of task in your project. (Required)
file_path is a path to data. Supported extensions are png, jpg, jpeg. (Required)
status can be 'registered', 'in_progress', 'completed', 'skipped', 'in_review', 'send_backed', 'approved', 'customer_in_review', 'customer_send_backed', 'customer_approved'. (Optional)
annotations is a list of annotation to be set in advance. (Optional)
tags is a list of tag to be set in advance. (Optional)
"""
endpoint = "tasks/video"
Expand All @@ -412,6 +414,10 @@ def create_video_task(
payload = {"project": project, "name": name, "file": file}
if status:
payload["status"] = status
if annotations:
for annotation in annotations:
annotation["content"] = name
payload["annotations"] = annotations
if tags:
payload["tags"] = tags
return self.api.post_request(endpoint, payload=payload)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setuptools.setup(
name="fastlabel",
version="0.9.0",
version="0.9.1",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@faycute 機能追加だけど、変更内容がほぼないので0.10.0ではなく、0.9.1にしてます。後でドキュメントも追加します。

author="eisuke-ueta",
author_email="eisuke.ueta@fastlabel.ai",
description="The official Python SDK for FastLabel API, the Data Platform for AI",
Expand Down