Skip to content
This repository was archived by the owner on Jun 4, 2025. It is now read-only.

Commit 3119b2f

Browse files
authored
Remove dataset_stats() autodownload capability (ultralytics#6303)
* Remove `dataset_stats()` autodownload capability @kalenmike security update per Slack convo * Update datasets.py
1 parent db1f83b commit 3119b2f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

utils/datasets.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -936,11 +936,10 @@ def verify_image_label(args):
936936
return [None, None, None, None, nm, nf, ne, nc, msg]
937937

938938

939-
def dataset_stats(path='coco128.yaml', autodownload=False, verbose=False, profile=False, hub=False):
939+
def dataset_stats(path='coco128.yaml', verbose=False, profile=False, hub=False):
940940
""" Return dataset statistics dictionary with images and instances counts per split per class
941941
To run in parent directory: export PYTHONPATH="$PWD/yolov5"
942-
Usage1: from utils.datasets import *; dataset_stats('coco128.yaml', autodownload=True)
943-
Usage2: from utils.datasets import *; dataset_stats('../datasets/coco128_with_yaml.zip')
942+
Usage: from utils.datasets import *; dataset_stats('../datasets/coco128_with_yaml.zip')
944943
Arguments
945944
path: Path to data.yaml or data.zip (with data.yaml inside data.zip)
946945
autodownload: Attempt to download dataset if not found locally
@@ -984,7 +983,7 @@ def hub_ops(f, max_dim=1920):
984983
data = yaml.safe_load(f) # data dict
985984
if zipped:
986985
data['path'] = data_dir # TODO: should this be dir.resolve()?
987-
check_dataset(data, autodownload) # download dataset if missing
986+
check_dataset(data, autodownload=False)
988987
hub_dir = Path(data['path'] + ('-hub' if hub else ''))
989988
stats = {'nc': data['nc'], 'names': data['names']} # statistics dictionary
990989
for split in 'train', 'val', 'test':

0 commit comments

Comments
 (0)