Skip to content

Commit 431bba4

Browse files
committed
add get appendixes data
1 parent f0364e4 commit 431bba4

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2204,6 +2204,32 @@ The folder structure inside the ZIP file is as follows
22042204
└── 000003.yaml
22052205
```
22062206

2207+
### Export Camera Calibration and Image
2208+
```python
2209+
appendix_data = client.get_appendix_data(
2210+
project="YOUR_PROJECT_SLUG"
2211+
# option param is filter task
2212+
status=None,
2213+
external_status=None,
2214+
tags=None,
2215+
task_name=None,
2216+
offset=None,
2217+
limit=10000,
2218+
)
2219+
```
2220+
2221+
Result data
2222+
```
2223+
[{
2224+
id: uuid
2225+
url: image file download url
2226+
format: calibration format (yml or kitti or None)
2227+
imageFileName: {task_name}/{content_name}/{image_file_name}
2228+
calibrationFileName: {task_name}/{content_name}/{yml_or_txt_fileName} or None
2229+
calibration: Camera calibration data to write to the calibration file
2230+
},...]
2231+
```
2232+
22072233
## Annotation
22082234

22092235
### Create Annotation

fastlabel/__init__.py

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2000,6 +2000,58 @@ def import_appendix_file(
20002000

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

2003+
def get_appendix_data(
2004+
self,
2005+
project: str,
2006+
status: str = None,
2007+
external_status: str = None,
2008+
tags: list = None,
2009+
task_name: str = None,
2010+
offset: int = None,
2011+
limit: int = 10000,
2012+
) -> list:
2013+
"""
2014+
Returns a list of appendixes urls and params.
2015+
params = {
2016+
id: uuid,
2017+
url: image file url,
2018+
name: {task_name}/{content_name}/{file_name},
2019+
format: yml or kitti or none,
2020+
calibration: calibration data,
2021+
}
2022+
2023+
project is slug of your project (Required).
2024+
status can be 'registered', 'completed', 'skipped',
2025+
'reviewed', 'sent_back', 'approved', 'declined'. (Optional)
2026+
external_status can be 'registered', 'completed', 'skipped',
2027+
'reviewed', 'sent_back', 'approved', 'declined',
2028+
'customer_declined' (Optional).
2029+
tags is a list of tag (Optional).
2030+
task_name is a task name (Optional).
2031+
offset is the starting position number to fetch (Optional).
2032+
limit is the max number to fetch (Optional).
2033+
"""
2034+
if limit > 10000:
2035+
raise FastLabelInvalidException(
2036+
"Limit must be less than or equal to 10000.", 422
2037+
)
2038+
endpoint = "contents/export/appendix"
2039+
params = {"project": project}
2040+
if status:
2041+
params["status"] = status
2042+
if external_status:
2043+
params["externalStatus"] = external_status
2044+
if tags:
2045+
params["tags"] = tags
2046+
if task_name:
2047+
params["taskName"] = task_name
2048+
if offset:
2049+
params["offset"] = offset
2050+
if limit:
2051+
params["limit"] = limit
2052+
2053+
return self.api.get_request(endpoint, params=params)
2054+
20032055
# Task Update
20042056

20052057
def update_task(

0 commit comments

Comments
 (0)