File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2082,6 +2082,17 @@ task_id = client.create_robotics_task(
20822082)
20832083```
20842084
2085+ #### Import Contents
2086+
2087+ Import contents zip file
2088+
2089+ ``` python
2090+ history = client.import_robotics_contents_file(
2091+ project = " YOUR_PROJECT_SLUG" ,
2092+ file_path = " ZIP_FILE_PATH" ,
2093+ )
2094+ ```
2095+
20852096### Common
20862097
20872098APIs for update and delete and count are same over all tasks.
Original file line number Diff line number Diff line change @@ -2100,6 +2100,32 @@ def get_appendix_data(
21002100
21012101 return self .api .get_request (endpoint , params = params )
21022102
2103+ def import_robotics_contents_file (
2104+ self ,
2105+ project : str ,
2106+ file_path : str ,
2107+ ) -> list :
2108+ """
2109+ Import robotics contents file zip.
2110+ project is slug of your project (Required).
2111+ file_path is a path to data. Supported extensions are zip (Required).
2112+ """
2113+
2114+ if not utils .is_robotics_contents_supported_ext (file_path ):
2115+ raise FastLabelInvalidException ("Supported extensions are zip." , 422 )
2116+
2117+ endpoint = "contents/imports/robotics-contents/batch"
2118+ payload = {"project" : project }
2119+ signed_url = self .__get_signed_path (
2120+ project = project ,
2121+ file_name = os .path .basename (file_path ),
2122+ file_type = "application/zip" ,
2123+ )
2124+ self .api .upload_zipfile (url = signed_url ["url" ], file_path = file_path )
2125+ payload ["fileKey" ] = signed_url ["name" ]
2126+
2127+ return self .api .post_request (endpoint , payload = payload )
2128+
21032129 # Task Update
21042130
21052131 def update_task (
Original file line number Diff line number Diff line change @@ -46,6 +46,10 @@ def is_appendix_supported_ext(file_path: str) -> bool:
4646 return file_path .lower ().endswith ((".zip" ))
4747
4848
49+ def is_robotics_contents_supported_ext (file_path : str ) -> bool :
50+ return file_path .lower ().endswith ((".zip" ))
51+
52+
4953def is_pcd_supported_ext (file_path : str ) -> bool :
5054 # .ply is not yet supported. To support it, modification of the API
5155 # needs to be considered as well.
You can’t perform that action at this time.
0 commit comments