Skip to content

Commit 33b5e35

Browse files
Merge pull request #235 from fastlabel/feature/8021-add-get-appendixes-data
add get appendixes data
2 parents 70b0fb6 + 431bba4 commit 33b5e35

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
@@ -2202,6 +2202,32 @@ The folder structure inside the ZIP file is as follows
22022202
└── 000003.yaml
22032203
```
22042204

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

22072233
### 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)