File tree Expand file tree Collapse file tree 3 files changed +60
-0
lines changed Expand file tree Collapse file tree 3 files changed +60
-0
lines changed Original file line number Diff line number Diff line change 2020 - [ Sequential PCD] ( #sequential-pcd )
2121 - [ DICOM] ( #dicom )
2222 - [ Common] ( #common )
23+ - [ Appendix] ( #appendix )
2324- [ Annotation] ( #annotation )
2425- [ Project] ( #project )
2526- [ Dataset] ( #dataset )
@@ -2174,6 +2175,35 @@ Example of a single history object
21742175}
21752176```
21762177
2178+
2179+ ## Appendix
2180+
2181+ Processing of various types of appendix information is supported.
2182+
2183+ ### Import Camera Calibration
2184+
2185+ Import camera calibration and image appendix information for tasks in pcd and sequential pcd projects.
2186+
2187+
2188+ ``` python
2189+ client.import_appendix_file(project = " YOUR_PROJECT_SLUG" , file_path = " ZIP_FILE_PATH" )
2190+ ```
2191+
2192+ The folder structure inside the ZIP file is as follows
2193+
2194+ ```
2195+ .
2196+ └── task_name
2197+ ├── content_name_1.pcd
2198+ │ ├── 000001.png
2199+ │ └── 000001.yaml
2200+ └── content_name_2.pcd
2201+ ├── 000002.png
2202+ ├── 000002.yaml
2203+ ├── 000003.png
2204+ └── 000003.yaml
2205+ ```
2206+
21772207## Annotation
21782208
21792209### Create Annotation
Original file line number Diff line number Diff line change @@ -1974,6 +1974,32 @@ def create_sequential_pcd_task(
19741974
19751975 return self .api .post_request (endpoint , payload = payload )
19761976
1977+ def import_appendix_file (
1978+ self ,
1979+ project : str ,
1980+ file_path : str ,
1981+ ) -> list :
1982+ """
1983+ Import calibration file zip.
1984+ project is slug of your project (Required).
1985+ file_path is a path to data. Supported extensions are zip (Required).
1986+ """
1987+
1988+ if not utils .is_appendix_supported_ext (file_path ):
1989+ raise FastLabelInvalidException ("Supported extensions are zip." , 422 )
1990+
1991+ endpoint = "contents/imports/appendix/batch"
1992+ payload = {"project" : project }
1993+ signed_url = self .__get_signed_path (
1994+ project = project ,
1995+ file_name = os .path .basename (file_path ),
1996+ file_type = "application/zip" ,
1997+ )
1998+ self .api .upload_zipfile (url = signed_url ["url" ], file_path = file_path )
1999+ payload ["fileKey" ] = signed_url ["name" ]
2000+
2001+ return self .api .post_request (endpoint , payload = payload )
2002+
19772003 # Task Update
19782004
19792005 def update_task (
Original file line number Diff line number Diff line change @@ -42,6 +42,10 @@ def is_dicom_supported_ext(file_path: str) -> bool:
4242 return file_path .lower ().endswith ((".zip" ))
4343
4444
45+ def is_appendix_supported_ext (file_path : str ) -> bool :
46+ return file_path .lower ().endswith ((".zip" ))
47+
48+
4549def is_pcd_supported_ext (file_path : str ) -> bool :
4650 # .ply is not yet supported. To support it, modification of the API
4751 # needs to be considered as well.
You can’t perform that action at this time.
0 commit comments