Skip to content

Commit

Permalink
improved name of roboflow dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
kozlov721 committed Oct 7, 2024
1 parent c4e2cff commit 2d2a74d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions luxonis_ml/data/parsers/luxonis_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,12 @@ def __init__(
names.
"""
save_dir = Path(save_dir) if save_dir else None
name = dataset_dir.split("/")[-1]
if dataset_dir.startswith("roboflow://"):
self.dataset_dir = self._download_roboflow_dataset(
self.dataset_dir, name = self._download_roboflow_dataset(
dataset_dir, save_dir
)
else:
name = dataset_dir.split("/")[-1]
local_path = (save_dir or Path.cwd()) / name
self.dataset_dir = LuxonisFileSystem.download(
dataset_dir, local_path
Expand Down Expand Up @@ -256,7 +256,7 @@ def _parse_split(

def _download_roboflow_dataset(
self, dataset_dir: str, local_path: Optional[Path]
) -> Path:
) -> Tuple[Path, str]:
rf = Roboflow(api_key=environ.ROBOFLOW_API_KEY)
parts = dataset_dir.split("roboflow://")[1].split("/")
if len(parts) != 4:
Expand All @@ -281,5 +281,4 @@ def _download_roboflow_dataset(
.version(int(version))
.download(format, str(local_path))
)
print(dataset.location)
return Path(dataset.location)
return Path(dataset.location), project

0 comments on commit 2d2a74d

Please sign in to comment.