@@ -74,11 +74,7 @@ def __init__(
74
74
else :
75
75
self .__api_key = api_key
76
76
self .name = name
77
-
78
- # FIXME: the version argument is inconsistently passed into this object.
79
- # Sometimes it is passed as: test-workspace/test-project/2
80
- # Other times, it is passed as: 2
81
- self .version = version
77
+ self .version = unwrap_version_id (version_id = version )
82
78
self .type = type
83
79
self .augmentation = version_dict ["augmentation" ]
84
80
self .created = version_dict ["created" ]
@@ -139,7 +135,6 @@ def __check_if_generating(self):
139
135
url = f"{ API_URL } /{ self .workspace } /{ self .project } /{ self .version } ?nocache=true"
140
136
response = requests .get (url , params = {"api_key" : self .__api_key })
141
137
response .raise_for_status ()
142
-
143
138
if response .json ()["version" ]["progress" ] == None :
144
139
progress = 0.0
145
140
else :
@@ -197,11 +192,11 @@ def download(self, model_format=None, location=None, overwrite: bool = True):
197
192
try :
198
193
import_module ("ultralytics" )
199
194
print_warn_for_wrong_dependencies_versions (
200
- [("ultralytics" , "==" , "8.0.134 " )]
195
+ [("ultralytics" , "==" , "8.0.196 " )]
201
196
)
202
197
except ImportError as e :
203
198
print (
204
- "[WARNING] we noticed you are downloading a `yolov8` datasets but you don't have `ultralytics` installed. Roboflow `.deploy` supports only models trained with `ultralytics==8.0.134 `, to intall it `pip install ultralytics==8.0.134 `."
199
+ "[WARNING] we noticed you are downloading a `yolov8` datasets but you don't have `ultralytics` installed. Roboflow `.deploy` supports only models trained with `ultralytics==8.0.196 `, to intall it `pip install ultralytics==8.0.196 `."
205
200
)
206
201
# silently fail
207
202
pass
@@ -460,7 +455,7 @@ def live_plot(epochs, mAP, loss, title=""):
460
455
# return the model object
461
456
return self .model
462
457
463
- # @warn_for_wrong_dependencies_versions([("ultralytics", "==", "8.0.134 ")])
458
+ # @warn_for_wrong_dependencies_versions([("ultralytics", "==", "8.0.196 ")])
464
459
def deploy (self , model_type : str , model_path : str ) -> None :
465
460
"""Uploads provided weights file to Roboflow
466
461
@@ -490,7 +485,7 @@ def deploy(self, model_type: str, model_path: str) -> None:
490
485
)
491
486
492
487
print_warn_for_wrong_dependencies_versions (
493
- [("ultralytics" , "==" , "8.0.134 " )], ask_to_continue = True
488
+ [("ultralytics" , "==" , "8.0.196 " )], ask_to_continue = True
494
489
)
495
490
496
491
elif "yolov5" in model_type or "yolov7" in model_type :
@@ -775,7 +770,7 @@ def data_yaml_callback(content: dict) -> dict:
775
770
try :
776
771
# get_wrong_dependencies_versions raises exception if ultralytics is not installed at all
777
772
if format == "yolov8" and not get_wrong_dependencies_versions (
778
- dependencies_versions = [("ultralytics" , "==" , "8.0.134 " )]
773
+ dependencies_versions = [("ultralytics" , "==" , "8.0.196 " )]
779
774
):
780
775
content ["train" ] = "train/images"
781
776
content ["val" ] = "valid/images"
@@ -802,3 +797,7 @@ def __str__(self):
802
797
"workspace" : self .workspace ,
803
798
}
804
799
return json .dumps (json_value , indent = 2 )
800
+
801
+
802
+ def unwrap_version_id (version_id : str ) -> str :
803
+ return version_id if "/" not in str (version_id ) else version_id .split ("/" )[- 1 ]
0 commit comments