From 37e0f6e0e40435c3b1a20625af3c214d16c675bc Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Thu, 29 Dec 2022 14:58:03 +0100 Subject: [PATCH] Import DEFAULT_CONFIG from utils/__init__.py (#115) --- ultralytics/yolo/engine/validator.py | 3 +-- ultralytics/yolo/v8/classify/predict.py | 2 +- ultralytics/yolo/v8/classify/val.py | 2 +- ultralytics/yolo/v8/detect/predict.py | 3 +-- ultralytics/yolo/v8/detect/val.py | 3 +-- ultralytics/yolo/v8/segment/predict.py | 3 +-- ultralytics/yolo/v8/segment/train.py | 2 +- ultralytics/yolo/v8/segment/val.py | 3 +-- 8 files changed, 8 insertions(+), 13 deletions(-) diff --git a/ultralytics/yolo/engine/validator.py b/ultralytics/yolo/engine/validator.py index 3be5587..7a27c58 100644 --- a/ultralytics/yolo/engine/validator.py +++ b/ultralytics/yolo/engine/validator.py @@ -7,8 +7,7 @@ from tqdm import tqdm from ultralytics.nn.autobackend import AutoBackend from ultralytics.yolo.data.utils import check_dataset, check_dataset_yaml -from ultralytics.yolo.engine.trainer import DEFAULT_CONFIG -from ultralytics.yolo.utils import LOGGER, RANK, TQDM_BAR_FORMAT +from ultralytics.yolo.utils import DEFAULT_CONFIG, LOGGER, RANK, TQDM_BAR_FORMAT from ultralytics.yolo.utils.files import increment_path from ultralytics.yolo.utils.ops import Profile from ultralytics.yolo.utils.torch_utils import check_imgsz, de_parallel, select_device, smart_inference_mode diff --git a/ultralytics/yolo/v8/classify/predict.py b/ultralytics/yolo/v8/classify/predict.py index fe9b7b5..f2c00df 100644 --- a/ultralytics/yolo/v8/classify/predict.py +++ b/ultralytics/yolo/v8/classify/predict.py @@ -2,7 +2,7 @@ import hydra import torch from ultralytics.yolo.engine.predictor import BasePredictor -from ultralytics.yolo.engine.trainer import DEFAULT_CONFIG +from ultralytics.yolo.utils import DEFAULT_CONFIG from ultralytics.yolo.utils.plotting import Annotator diff --git a/ultralytics/yolo/v8/classify/val.py b/ultralytics/yolo/v8/classify/val.py index 9620e7f..d10de32 100644 --- a/ultralytics/yolo/v8/classify/val.py +++ b/ultralytics/yolo/v8/classify/val.py @@ -2,8 +2,8 @@ import hydra import torch from ultralytics.yolo.data import build_classification_dataloader -from ultralytics.yolo.engine.trainer import DEFAULT_CONFIG from ultralytics.yolo.engine.validator import BaseValidator +from ultralytics.yolo.utils import DEFAULT_CONFIG class ClassificationValidator(BaseValidator): diff --git a/ultralytics/yolo/v8/detect/predict.py b/ultralytics/yolo/v8/detect/predict.py index 26176c1..f41b199 100644 --- a/ultralytics/yolo/v8/detect/predict.py +++ b/ultralytics/yolo/v8/detect/predict.py @@ -2,8 +2,7 @@ import hydra import torch from ultralytics.yolo.engine.predictor import BasePredictor -from ultralytics.yolo.engine.trainer import DEFAULT_CONFIG -from ultralytics.yolo.utils import ops +from ultralytics.yolo.utils import DEFAULT_CONFIG, ops from ultralytics.yolo.utils.plotting import Annotator, colors, save_one_box diff --git a/ultralytics/yolo/v8/detect/val.py b/ultralytics/yolo/v8/detect/val.py index 7c95a77..e45e9a6 100644 --- a/ultralytics/yolo/v8/detect/val.py +++ b/ultralytics/yolo/v8/detect/val.py @@ -7,9 +7,8 @@ import torch from ultralytics.yolo.data import build_dataloader from ultralytics.yolo.data.dataloaders.v5loader import create_dataloader -from ultralytics.yolo.engine.trainer import DEFAULT_CONFIG from ultralytics.yolo.engine.validator import BaseValidator -from ultralytics.yolo.utils import colorstr, ops +from ultralytics.yolo.utils import DEFAULT_CONFIG, colorstr, ops from ultralytics.yolo.utils.checks import check_file, check_requirements from ultralytics.yolo.utils.files import yaml_load from ultralytics.yolo.utils.metrics import ConfusionMatrix, DetMetrics, box_iou diff --git a/ultralytics/yolo/v8/segment/predict.py b/ultralytics/yolo/v8/segment/predict.py index cc3066b..c149034 100644 --- a/ultralytics/yolo/v8/segment/predict.py +++ b/ultralytics/yolo/v8/segment/predict.py @@ -1,8 +1,7 @@ import hydra import torch -from ultralytics.yolo.engine.trainer import DEFAULT_CONFIG -from ultralytics.yolo.utils import ops +from ultralytics.yolo.utils import DEFAULT_CONFIG, ops from ultralytics.yolo.utils.plotting import colors, save_one_box from ..detect.predict import DetectionPredictor diff --git a/ultralytics/yolo/v8/segment/train.py b/ultralytics/yolo/v8/segment/train.py index 757a0dd..37284d3 100644 --- a/ultralytics/yolo/v8/segment/train.py +++ b/ultralytics/yolo/v8/segment/train.py @@ -5,7 +5,7 @@ import torch.nn.functional as F from ultralytics.nn.tasks import SegmentationModel from ultralytics.yolo import v8 -from ultralytics.yolo.engine.trainer import DEFAULT_CONFIG +from ultralytics.yolo.utils import DEFAULT_CONFIG from ultralytics.yolo.utils.loss import BboxLoss from ultralytics.yolo.utils.ops import crop_mask, xywh2xyxy, xyxy2xywh from ultralytics.yolo.utils.plotting import plot_images, plot_results diff --git a/ultralytics/yolo/v8/segment/val.py b/ultralytics/yolo/v8/segment/val.py index 6d9c848..2b05b09 100644 --- a/ultralytics/yolo/v8/segment/val.py +++ b/ultralytics/yolo/v8/segment/val.py @@ -5,8 +5,7 @@ import numpy as np import torch import torch.nn.functional as F -from ultralytics.yolo.engine.trainer import DEFAULT_CONFIG -from ultralytics.yolo.utils import ops +from ultralytics.yolo.utils import DEFAULT_CONFIG, ops from ultralytics.yolo.utils.metrics import ConfusionMatrix, SegmentMetrics, box_iou, mask_iou from ultralytics.yolo.utils.plotting import output_to_target, plot_images