@@ -482,23 +482,28 @@ def upload_image(
482
482
project_url = self .id .rsplit ("/" )[1 ]
483
483
484
484
t0 = time .time ()
485
+ upload_retry_attempts = 0
485
486
retry = Retry (num_retry_uploads , ImageUploadError )
486
487
487
- image = retry (
488
- rfapi .upload_image ,
489
- self .__api_key ,
490
- project_url ,
491
- image_path ,
492
- hosted_image = hosted_image ,
493
- split = split ,
494
- batch_name = batch_name ,
495
- tag_names = tag_names ,
496
- sequence_number = sequence_number ,
497
- sequence_size = sequence_size ,
498
- ** kwargs ,
499
- )
488
+ try :
489
+ image = retry (
490
+ rfapi .upload_image ,
491
+ self .__api_key ,
492
+ project_url ,
493
+ image_path ,
494
+ hosted_image = hosted_image ,
495
+ split = split ,
496
+ batch_name = batch_name ,
497
+ tag_names = tag_names ,
498
+ sequence_number = sequence_number ,
499
+ sequence_size = sequence_size ,
500
+ ** kwargs ,
501
+ )
502
+ upload_retry_attempts = retry .retries
503
+ except ImageUploadError as e :
504
+ e .retries = upload_retry_attempts
505
+ raise e
500
506
501
- upload_retry_attempts = retry .retries
502
507
upload_time = time .time () - t0
503
508
504
509
return image , upload_time , upload_retry_attempts
@@ -508,7 +513,7 @@ def save_annotation(
508
513
annotation_path = None ,
509
514
annotation_labelmap = None ,
510
515
image_id = None ,
511
- batch_name = None ,
516
+ job_name = None ,
512
517
is_prediction : bool = False ,
513
518
annotation_overwrite = False ,
514
519
):
@@ -522,7 +527,7 @@ def save_annotation(
522
527
annotation_name , # type: ignore[type-var]
523
528
annotation_str , # type: ignore[type-var]
524
529
image_id ,
525
- job_name = batch_name , # type: ignore[type-var]
530
+ job_name = job_name , # type: ignore[type-var]
526
531
is_prediction = is_prediction ,
527
532
annotation_labelmap = annotation_labelmap ,
528
533
overwrite = annotation_overwrite ,
0 commit comments