@@ -99,7 +99,6 @@ def versions(self):
9999 return version_array
100100
101101 def generate_version (self , settings ):
102-
103102 """
104103 Settings, a python dict with augmentation and preprocessing keys and specifications for generation.
105104 These settings mirror capabilities available via the Roboflow UI.
@@ -239,7 +238,6 @@ def version(self, version_number, local=None):
239238 version_info = self .get_version_information ()
240239
241240 for version_object in version_info :
242-
243241 current_version_num = os .path .basename (version_object ["id" ])
244242 if current_version_num == str (version_number ):
245243 vers = Version (
@@ -264,6 +262,7 @@ def __image_upload(
264262 hosted_image = False ,
265263 split = "train" ,
266264 batch_name = DEFAULT_BATCH_NAME ,
265+ ** kwargs ,
267266 ):
268267 """function to upload image to the specific project
269268 :param image_path: path to image you'd like to upload.
@@ -294,6 +293,8 @@ def __image_upload(
294293 batch_name ,
295294 ]
296295 )
296+ for key , value in kwargs .items ():
297+ self .image_upload_url += "&" + str (key ) + "=" + str (value )
297298
298299 # Convert to PIL Image
299300 img = cv2 .imread (image_path )
@@ -382,8 +383,8 @@ def upload(
382383 split = "train" ,
383384 num_retry_uploads = 0 ,
384385 batch_name = DEFAULT_BATCH_NAME ,
386+ ** kwargs ,
385387 ):
386-
387388 """upload function
388389 :param image_path: path to image you'd like to upload
389390 :param annotation_path: if you're upload annotation, path to it
@@ -424,6 +425,7 @@ def upload(
424425 split = split ,
425426 num_retry_uploads = num_retry_uploads ,
426427 batch_name = batch_name ,
428+ ** kwargs ,
427429 )
428430 else :
429431 images = os .listdir (image_path )
@@ -438,6 +440,7 @@ def upload(
438440 split = split ,
439441 num_retry_uploads = num_retry_uploads ,
440442 batch_name = batch_name ,
443+ ** kwargs ,
441444 )
442445 print ("[ " + path + " ] was uploaded succesfully." )
443446 else :
@@ -453,8 +456,8 @@ def single_upload(
453456 split = "train" ,
454457 num_retry_uploads = 0 ,
455458 batch_name = DEFAULT_BATCH_NAME ,
459+ ** kwargs ,
456460 ):
457-
458461 success = False
459462 annotation_success = False
460463 # User gives image path
@@ -465,6 +468,7 @@ def single_upload(
465468 hosted_image = hosted_image ,
466469 split = split ,
467470 batch_name = batch_name ,
471+ ** kwargs ,
468472 )
469473 # Get JSON response values
470474 try :
@@ -504,6 +508,7 @@ def single_upload(
504508 image_id = image_id ,
505509 split = split ,
506510 num_retry_uploads = num_retry_uploads - 1 ,
511+ ** kwargs ,
507512 )
508513 return
509514 else :
0 commit comments