diff --git a/README.md b/README.md index 6df5233..4b28588 100644 --- a/README.md +++ b/README.md @@ -2133,6 +2133,31 @@ client.delete_task_annotations(task_id="YOUR_TASK_ID") id_name_map = client.get_task_id_name_map(project="YOUR_PROJECT_SLUG") ``` +#### Get Task Appendix Data + +Get appendix data (URLs and parameters) for tasks. + +```python +appendix_data = client.get_task_appendix_data(project="YOUR_PROJECT_SLUG") +``` + +Filter by task name: + +```python +appendix_data = client.get_task_appendix_data( + project="YOUR_PROJECT_SLUG", + task_name="YOUR_TASK_NAME" +) +``` + +Response includes: + +- `id`: UUID of the appendix +- `url`: Image file URL +- `name`: Format is `{task_name}/{content_name}/{file_name}` +- `format`: `yml`, `kitti`, or `none` +- `calibration`: Calibration data + #### Count Task ```python diff --git a/fastlabel/__init__.py b/fastlabel/__init__.py index 377add3..990aea0 100644 --- a/fastlabel/__init__.py +++ b/fastlabel/__init__.py @@ -2100,6 +2100,43 @@ def get_appendix_data( return self.api.get_request(endpoint, params=params) + def get_task_appendix_data( + self, + project: str, + task_name: Optional[str] = None, + offset: Optional[int] = None, + limit: int = 10000, + ) -> list: + """ + Returns a list of appendixes urls and params. + params = { + id: uuid, + url: image file url, + name: {task_name}/{content_name}/{file_name}, + format: yml or kitti or none, + calibration: calibration data, + } + + project is slug of your project (Required). + 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 > 10000: + raise FastLabelInvalidException( + "Limit must be less than or equal to 10000.", 422 + ) + endpoint = "tasks/appendix" + params = {"project": project} + 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 import_robotics_contents_file( self, project: str,