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
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
- [PCD](#pcd)
- [Sequential PCD](#sequential-pcd)
- [DICOM](#dicom)
- [Robotics](#robotics)
- [Common](#common)
- [Appendix](#appendix)
- [Annotation](#annotation)
Expand Down Expand Up @@ -2064,6 +2065,23 @@ Example of a single dicom task object
}
```

### Robotics

Supported following project types:

- Robotics - Task Classification

#### Create Tasks

Create a new task (Content creation is required separately).

```python
task_id = client.create_robotics_task(
project="YOUR_PROJECT_SLUG",
name="TASK_NAME",
)
```

### Common

APIs for update and delete and count are same over all tasks.
Expand Down
47 changes: 47 additions & 0 deletions fastlabel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1975,6 +1975,53 @@ def create_sequential_pcd_task(

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

def create_robotics_task(
self,
project: str,
name: str,
status: Optional[str] = None,
external_status: Optional[str] = None,
priority: Optional[Priority] = None,
tags: Optional[list[str]] = None,
**kwargs,
) -> str:
"""
Create a single robotics task without content.

project is slug of your project (Required).
name is an unique identifier of task in your project (Required).
status can be 'registered', 'completed', 'skipped', 'reviewed', 'sent_back', 'approved', 'declined' (Optional).
external_status can be 'registered', 'completed', 'skipped', 'reviewed', 'sent_back', 'approved', 'declined', 'customer_declined' (Optional).
priority is the priority of the task (default: none) (Optional).
Set one of the numbers corresponding to:
none = 0,
low = 10,
medium = 20,
high = 30,
tags is a list of tag to be set in advance (Optional).
assignee is slug of assigned user (Optional).
reviewer is slug of review user (Optional).
approver is slug of approve user (Optional).
external_assignee is slug of external assigned user (Optional).
external_reviewer is slug of external review user (Optional).
external_approver is slug of external approve user (Optional).
"""
Comment on lines +1988 to +2008
Copy link
Contributor

Choose a reason for hiding this comment

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

コメントの実装、ありがとうございます!!

endpoint = "tasks/robotics"

payload = {"project": project, "name": name}
if status:
payload["status"] = status
if external_status:
payload["externalStatus"] = external_status
if priority is not None:
payload["priority"] = priority
if tags:
payload["tags"] = tags or []

self.__fill_assign_users(payload, **kwargs)

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

def import_appendix_file(
self,
project: str,
Expand Down
Loading