Skip to content

Commit 7fe28e5

Browse files
authored
Merge pull request #334 from roboflow/fix-yaml-yolo
bugfix - downloading yolov8 files incorrectly amends data.yaml
2 parents a823346 + c0e0e5a commit 7fe28e5

File tree

3 files changed

+5
-19
lines changed

3 files changed

+5
-19
lines changed

roboflow/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from roboflow.models import CLIPModel, GazeModel # noqa: F401
1616
from roboflow.util.general import write_line
1717

18-
__version__ = "1.1.47"
18+
__version__ = "1.1.48"
1919

2020

2121
def check_key(api_key, model, notebook, num_retries=0):

roboflow/core/version.py

+2-16
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import sys
88
import time
99
import zipfile
10-
from importlib import import_module
1110
from typing import TYPE_CHECKING, Optional, Union
1211

1312
import requests
@@ -206,19 +205,6 @@ def download(self, model_format=None, location=None, overwrite: bool = False):
206205

207206
self.__wait_if_generating()
208207

209-
if model_format == "yolov8":
210-
# if ultralytics is installed, we will assume users will want to use yolov8 and we check for the supported version # noqa: E501 // docs
211-
try:
212-
import_module("ultralytics")
213-
print_warn_for_wrong_dependencies_versions([("ultralytics", "==", "8.0.196")])
214-
except ImportError:
215-
print(
216-
"[WARNING] we noticed you are downloading a `yolov8` datasets but you don't have `ultralytics` installed. " # noqa: E501 // docs
217-
"Roboflow `.deploy` supports only models trained with `ultralytics==8.0.196`, to intall it `pip install ultralytics==8.0.196`." # noqa: E501 // docs
218-
)
219-
# silently fail
220-
pass
221-
222208
model_format = self.__get_format_identifier(model_format)
223209

224210
if model_format not in self.exports:
@@ -246,7 +232,7 @@ def download(self, model_format=None, location=None, overwrite: bool = False):
246232

247233
self.__download_zip(link, location, model_format)
248234
self.__extract_zip(location, model_format)
249-
self.__reformat_yaml(location, model_format)
235+
self.__reformat_yaml(location, model_format) # TODO: is roboflow-python a place to be munging yaml files?
250236

251237
return Dataset(self.name, self.version, model_format, os.path.abspath(location))
252238

@@ -957,7 +943,7 @@ def data_yaml_callback(content: dict) -> dict:
957943
content["train"] = location + content["train"].lstrip(".")
958944
content["val"] = location + content["val"].lstrip(".")
959945
content["test"] = location + content["test"].lstrip(".")
960-
if format in ["yolov5pytorch", "yolov7pytorch", "yolov8", "yolov9"]:
946+
if format in ["yolov5pytorch", "yolov7pytorch"]:
961947
content["train"] = location + content["train"].lstrip("..")
962948
content["val"] = location + content["val"].lstrip("..")
963949
try:

tests/manual/debugme.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# args = parser.parse_args(f"upload {thisdir}/../datasets/chess -w wolfodorpythontests -p chess".split()) # noqa: E501 // docs
1919
args = parser.parse_args(
2020
# ["login"]
21-
# "download https://universe.roboflow.com/gdit/aerial-airport".split()
21+
"download -f yolov8 https://universe.roboflow.com/gdit/aerial-airport".split()
2222
# "project list -w wolfodorpythontests".split()
2323
# "project get cultura-pepino-dark".split()
2424
# "workspace list".split()
@@ -42,6 +42,6 @@
4242
# f"import {thisdir}/data/cultura-pepino-yolov5pytorch -w wolfodorpythontests -p yellow-auto -c 100 -n papaiasso".split() # noqa: E501 // docs
4343
# f"import {thisdir}/../datasets/mosquitos -w wolfodorpythontests -p yellow-auto -n papaiasso".split() # noqa: E501 // docs
4444
# f"deployment list".split() # noqa: E501 // docs
45-
f"import -w tonyprivate -p meh-plvrv {thisdir}/../datasets/paligemma/".split() # noqa: E501 // docs
45+
# f"import -w tonyprivate -p meh-plvrv {thisdir}/../datasets/paligemma/".split() # noqa: E501 // docs
4646
)
4747
args.func(args)

0 commit comments

Comments
 (0)