Apply Ruff 0.9.0 (#18622)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com> Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
cc1e77138c
commit
3902e740cf
22 changed files with 69 additions and 65 deletions
|
|
@ -451,7 +451,7 @@ def check_cls_dataset(dataset, split=""):
|
|||
|
||||
# Print to console
|
||||
for k, v in {"train": train_set, "val": val_set, "test": test_set}.items():
|
||||
prefix = f'{colorstr(f"{k}:")} {v}...'
|
||||
prefix = f"{colorstr(f'{k}:')} {v}..."
|
||||
if v is None:
|
||||
LOGGER.info(prefix)
|
||||
else:
|
||||
|
|
@ -519,7 +519,7 @@ class HUBDatasetStats:
|
|||
except Exception as e:
|
||||
raise Exception("error/HUB/dataset_stats/init") from e
|
||||
|
||||
self.hub_dir = Path(f'{data["path"]}-hub')
|
||||
self.hub_dir = Path(f"{data['path']}-hub")
|
||||
self.im_dir = self.hub_dir / "images"
|
||||
self.stats = {"nc": len(data["names"]), "names": list(data["names"].values())} # statistics dictionary
|
||||
self.data = data
|
||||
|
|
@ -531,7 +531,7 @@ class HUBDatasetStats:
|
|||
return False, None, path
|
||||
unzip_dir = unzip_file(path, path=path.parent)
|
||||
assert unzip_dir.is_dir(), (
|
||||
f"Error unzipping {path}, {unzip_dir} not found. " f"path/to/abc.zip MUST unzip to path/to/abc/"
|
||||
f"Error unzipping {path}, {unzip_dir} not found. path/to/abc.zip MUST unzip to path/to/abc/"
|
||||
)
|
||||
return True, str(unzip_dir), find_dataset_yaml(unzip_dir) # zipped, data_dir, yaml_path
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue