ultralytics 8.0.18 new python callbacks and minor fixes (#580)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Jeroen Rombouts <36196499+jarombouts@users.noreply.github.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Ayush Chaurasia
2023-01-23 23:01:29 +05:30
committed by GitHub
parent e9ab157330
commit 936414c615
24 changed files with 136 additions and 106 deletions

View File

@ -28,7 +28,7 @@ from PIL import ExifTags, Image, ImageOps
from torch.utils.data import DataLoader, Dataset, dataloader, distributed
from tqdm import tqdm
from ultralytics.yolo.data.utils import check_dataset, unzip_file
from ultralytics.yolo.data.utils import check_det_dataset, unzip_file
from ultralytics.yolo.utils import (DATASETS_DIR, LOGGER, NUM_THREADS, TQDM_BAR_FORMAT, is_colab, is_dir_writeable,
is_kaggle)
from ultralytics.yolo.utils.checks import check_requirements, check_yaml
@ -1061,7 +1061,7 @@ class HUBDatasetStats():
except Exception as e:
raise Exception("error/HUB/dataset_stats/yaml_load") from e
check_dataset(data, autodownload) # download dataset if missing
check_det_dataset(data, autodownload) # download dataset if missing
self.hub_dir = Path(data['path'] + '-hub')
self.im_dir = self.hub_dir / 'images'
self.im_dir.mkdir(parents=True, exist_ok=True) # makes /images

View File

@ -185,7 +185,7 @@ def polygons2masks_overlap(imgsz, segments, downsample_ratio=1):
return masks, index
def check_dataset_yaml(dataset, autodownload=True):
def check_det_dataset(dataset, autodownload=True):
# Download, check and/or unzip dataset if not found locally
data = check_file(dataset)
@ -254,7 +254,7 @@ def check_dataset_yaml(dataset, autodownload=True):
return data # dictionary
def check_dataset(dataset: str):
def check_cls_dataset(dataset: str):
"""
Check a classification dataset such as Imagenet.