Rename `utils/datasets.py` > `utils/dataloaders.py` (#7799)
This commit is contained in:
parent
5a1ef32553
commit
9d8ed37df7
|
|
@ -39,7 +39,7 @@ if str(ROOT) not in sys.path:
|
||||||
ROOT = Path(os.path.relpath(ROOT, Path.cwd())) # relative
|
ROOT = Path(os.path.relpath(ROOT, Path.cwd())) # relative
|
||||||
|
|
||||||
from models.common import DetectMultiBackend
|
from models.common import DetectMultiBackend
|
||||||
from utils.datasets import IMG_FORMATS, VID_FORMATS, LoadImages, LoadStreams
|
from utils.dataloaders import IMG_FORMATS, VID_FORMATS, LoadImages, LoadStreams
|
||||||
from utils.general import (LOGGER, check_file, check_img_size, check_imshow, check_requirements, colorstr, cv2,
|
from utils.general import (LOGGER, check_file, check_img_size, check_imshow, check_requirements, colorstr, cv2,
|
||||||
increment_path, non_max_suppression, print_args, scale_coords, strip_optimizer, xyxy2xywh)
|
increment_path, non_max_suppression, print_args, scale_coords, strip_optimizer, xyxy2xywh)
|
||||||
from utils.plots import Annotator, colors, save_one_box
|
from utils.plots import Annotator, colors, save_one_box
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ if platform.system() != 'Windows':
|
||||||
|
|
||||||
from models.experimental import attempt_load
|
from models.experimental import attempt_load
|
||||||
from models.yolo import Detect
|
from models.yolo import Detect
|
||||||
from utils.datasets import LoadImages
|
from utils.dataloaders import LoadImages
|
||||||
from utils.general import (LOGGER, check_dataset, check_img_size, check_requirements, check_version, colorstr,
|
from utils.general import (LOGGER, check_dataset, check_img_size, check_requirements, check_version, colorstr,
|
||||||
file_size, print_args, url2file)
|
file_size, print_args, url2file)
|
||||||
from utils.torch_utils import select_device
|
from utils.torch_utils import select_device
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ import yaml
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
from torch.cuda import amp
|
from torch.cuda import amp
|
||||||
|
|
||||||
from utils.datasets import exif_transpose, letterbox
|
from utils.dataloaders import exif_transpose, letterbox
|
||||||
from utils.general import (LOGGER, check_requirements, check_suffix, check_version, colorstr, increment_path,
|
from utils.general import (LOGGER, check_requirements, check_suffix, check_version, colorstr, increment_path,
|
||||||
make_divisible, non_max_suppression, scale_coords, xywh2xyxy, xyxy2xywh)
|
make_divisible, non_max_suppression, scale_coords, xywh2xyxy, xyxy2xywh)
|
||||||
from utils.plots import Annotator, colors, save_one_box
|
from utils.plots import Annotator, colors, save_one_box
|
||||||
|
|
|
||||||
2
train.py
2
train.py
|
|
@ -44,7 +44,7 @@ from models.yolo import Model
|
||||||
from utils.autoanchor import check_anchors
|
from utils.autoanchor import check_anchors
|
||||||
from utils.autobatch import check_train_batch_size
|
from utils.autobatch import check_train_batch_size
|
||||||
from utils.callbacks import Callbacks
|
from utils.callbacks import Callbacks
|
||||||
from utils.datasets import create_dataloader
|
from utils.dataloaders import create_dataloader
|
||||||
from utils.downloads import attempt_download
|
from utils.downloads import attempt_download
|
||||||
from utils.general import (LOGGER, check_dataset, check_file, check_git_status, check_img_size, check_requirements,
|
from utils.general import (LOGGER, check_dataset, check_file, check_git_status, check_img_size, check_requirements,
|
||||||
check_suffix, check_version, check_yaml, colorstr, get_latest_run, increment_path,
|
check_suffix, check_version, check_yaml, colorstr, get_latest_run, increment_path,
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,7 @@ def kmean_anchors(dataset='./data/coco128.yaml', n=9, img_size=640, thr=4.0, gen
|
||||||
if isinstance(dataset, str): # *.yaml file
|
if isinstance(dataset, str): # *.yaml file
|
||||||
with open(dataset, errors='ignore') as f:
|
with open(dataset, errors='ignore') as f:
|
||||||
data_dict = yaml.safe_load(f) # model dict
|
data_dict = yaml.safe_load(f) # model dict
|
||||||
from utils.datasets import LoadImagesAndLabels
|
from utils.dataloaders import LoadImagesAndLabels
|
||||||
dataset = LoadImagesAndLabels(data_dict['train'], augment=True, rect=True)
|
dataset = LoadImagesAndLabels(data_dict['train'], augment=True, rect=True)
|
||||||
|
|
||||||
# Get label wh
|
# Get label wh
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ ROOT = FILE.parents[3] # YOLOv5 root directory
|
||||||
if str(ROOT) not in sys.path:
|
if str(ROOT) not in sys.path:
|
||||||
sys.path.append(str(ROOT)) # add ROOT to PATH
|
sys.path.append(str(ROOT)) # add ROOT to PATH
|
||||||
|
|
||||||
from utils.datasets import LoadImagesAndLabels, img2label_paths
|
from utils.dataloaders import LoadImagesAndLabels, img2label_paths
|
||||||
from utils.general import LOGGER, check_dataset, check_file
|
from utils.general import LOGGER, check_dataset, check_file
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
2
val.py
2
val.py
|
|
@ -37,7 +37,7 @@ ROOT = Path(os.path.relpath(ROOT, Path.cwd())) # relative
|
||||||
|
|
||||||
from models.common import DetectMultiBackend
|
from models.common import DetectMultiBackend
|
||||||
from utils.callbacks import Callbacks
|
from utils.callbacks import Callbacks
|
||||||
from utils.datasets import create_dataloader
|
from utils.dataloaders import create_dataloader
|
||||||
from utils.general import (LOGGER, check_dataset, check_img_size, check_requirements, check_yaml,
|
from utils.general import (LOGGER, check_dataset, check_img_size, check_requirements, check_yaml,
|
||||||
coco80_to_coco91_class, colorstr, increment_path, non_max_suppression, print_args,
|
coco80_to_coco91_class, colorstr, increment_path, non_max_suppression, print_args,
|
||||||
scale_coords, xywh2xyxy, xyxy2xywh)
|
scale_coords, xywh2xyxy, xyxy2xywh)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue