@@ -36,7 +36,7 @@ def create_upload_dict(client:labelboxClient, table: pandas.core.frame.DataFrame
36
36
dataset_id_col :str , dataset_id :str , project_id_col :str , project_id :str ,
37
37
model_id_col :str , model_id :str , model_run_id_col :str , model_run_id :str ,
38
38
metadata_index :dict , attachment_index :dict , annotation_index :dict , prediction_index :dict ,
39
- create_action , annotate_action , prediction_action ,
39
+ create_action , annotate_action , prediction_action , batch_action ,
40
40
upload_method :str , mask_method :str , divider :str , verbose :bool , extra_client :bool = None ):
41
41
"""
42
42
Args:
@@ -96,6 +96,7 @@ def create_upload_dict(client:labelboxClient, table: pandas.core.frame.DataFrame
96
96
ontology = client .get_project (projectId ).ontology (),
97
97
divider = divider , invert = True , detailed = True
98
98
)
99
+ ontology_index ['project_type' ] = str (client .get_project (projectId ).media_type )
99
100
project_id_to_ontology_index [projectId ] = ontology_index
100
101
# Get dictionary where {key=model_run_id : value=ontology_index}
101
102
model_run_id_to_ontology_index = {}
@@ -143,7 +144,7 @@ def create_upload_dict(client:labelboxClient, table: pandas.core.frame.DataFrame
143
144
model_id_col , model_id , model_run_id_col , model_run_id ,
144
145
metadata_index , attachment_index , annotation_index , prediction_index ,
145
146
project_id_to_ontology_index , model_run_id_to_ontology_index , model_id_to_model_run_id ,
146
- create_action , annotate_action , prediction_action ,
147
+ create_action , annotate_action , prediction_action , batch_action ,
147
148
metadata_name_key_to_schema , upload_method , mask_method , divider , verbose
148
149
))
149
150
for f in as_completed (futures ):
@@ -166,7 +167,7 @@ def create_upload(row_dict:dict, row_data_col:str, global_key_col:str, external_
166
167
model_id_col :str , model_id :str , model_run_id_col :str , model_run_id :str ,
167
168
metadata_index :dict , attachment_index :dict , annotation_index :dict , prediction_index :dict ,
168
169
project_id_to_ontology_index :dict , model_run_id_to_ontology_index :dict , model_id_to_model_run_id :dict ,
169
- create_action :bool , annotate_action :bool , prediction_action :bool ,
170
+ create_action :bool , annotate_action :bool , prediction_action :bool , batch_action : bool ,
170
171
metadata_name_key_to_schema :dict , upload_method :str , mask_method :str ,
171
172
divider :str , verbose :bool ):
172
173
""" Takes a single table row as-a-dictinary and returns a dictionary where:
@@ -213,7 +214,7 @@ def create_upload(row_dict:dict, row_data_col:str, global_key_col:str, external_
213
214
modelRunId = ""
214
215
# Create a base data row dictionary
215
216
data_row = {}
216
- if create_action :
217
+ if create_action or batch_action :
217
218
data_row ["row_data" ] = row_dict [row_data_col ]
218
219
data_row ["global_key" ] = row_dict [global_key_col ]
219
220
data_row ["external_id" ] = row_dict [external_id_col ]
0 commit comments