diff --git a/README.md b/README.md index 99721c7..7e33841 100644 --- a/README.md +++ b/README.md @@ -1642,6 +1642,28 @@ task_id = client.update_audio_classification_task( ) ``` +### Multi Modal Video Audio + +Supported following project types: + +- Multi Modal Video Audio - Segmentation + +#### Find Task + +Find a single task. + +```python +task = client.find_multi_modal_video_audio_task(task_id="YOUR_TASK_ID") +``` + +#### Get Tasks + +Get tasks. (Up to 10 tasks) + +```python +tasks = client.get_multi_modal_video_audio_tasks(project="YOUR_PROJECT_SLUG") +``` + ### PCD Supported following project types: diff --git a/examples/find_multi_modal_video_audio_task.py b/examples/find_multi_modal_video_audio_task.py new file mode 100644 index 0000000..8ed7fba --- /dev/null +++ b/examples/find_multi_modal_video_audio_task.py @@ -0,0 +1,8 @@ +from pprint import pprint + +import fastlabel + +client = fastlabel.Client() + +task = client.find_multi_modal_video_audio_task(task_id="YOUR_TASK_ID") +pprint(task) diff --git a/examples/get_multi_modal_video_audio_tasks.py b/examples/get_multi_modal_video_audio_tasks.py new file mode 100644 index 0000000..29d0b36 --- /dev/null +++ b/examples/get_multi_modal_video_audio_tasks.py @@ -0,0 +1,8 @@ +from pprint import pprint + +import fastlabel + +client = fastlabel.Client() + +tasks = client.get_multi_modal_video_audio_tasks(project="YOUR_PROJECT_SLUG") +pprint(tasks) diff --git a/fastlabel/__init__.py b/fastlabel/__init__.py index 1394fb7..1d702ed 100644 --- a/fastlabel/__init__.py +++ b/fastlabel/__init__.py @@ -226,6 +226,13 @@ def find_audio_classification_task(self, task_id: str) -> dict: endpoint = "tasks/audio/classification/" + task_id return self.api.get_request(endpoint) + def find_multi_modal_video_audio_task(self, task_id: str) -> dict: + """ + Find a single multi modal video audio task. + """ + endpoint = "tasks/multi-modal-video-audio/" + task_id + return self.api.get_request(endpoint) + def find_audio_task_by_name(self, project: str, task_name: str) -> dict: """ Find a single audio task by name. @@ -773,6 +780,51 @@ def get_audio_classification_tasks( params["limit"] = limit return self.api.get_request(endpoint, params=params) + def get_multi_modal_video_audio_tasks( + self, + project: str, + status: str = None, + external_status: str = None, + tags: list = [], + task_name: str = None, + offset: int = None, + limit: int = 10, + ) -> list: + """ + Returns a list of multi modal video audio tasks. + Returns up to 10 at a time, to get more, set offset as the starting position + to fetch. + + project is slug of 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). + tags is a list of tag (Optional). + task_name is a task name (Optional). + offset is the starting position number to fetch (Optional). + limit is the max number to fetch (Optional). + """ + if limit > 10: + raise FastLabelInvalidException( + "Limit must be less than or equal to 10.", 422 + ) + endpoint = "tasks/multi-modal-video-audio" + params = {"project": project} + if status: + params["status"] = status + if external_status: + params["externalStatus"] = external_status + if tags: + params["tags"] = tags + if task_name: + params["taskName"] = task_name + if offset: + params["offset"] = offset + if limit: + params["limit"] = limit + return self.api.get_request(endpoint, params=params) + def get_pcd_tasks( self, project: str,