Unverified 提交 95cef1ae authored 作者: Glenn Jocher's avatar Glenn Jocher 提交者: GitHub

Optimize imports (#9464)

* Optimize imports * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Reformat * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ciCo-authored-by: 's avatarpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
上级 8ae81a6c
...@@ -39,8 +39,6 @@ if str(ROOT) not in sys.path: ...@@ -39,8 +39,6 @@ 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
ROOT = Path(os.path.relpath(ROOT, Path.cwd())) # relative ROOT = Path(os.path.relpath(ROOT, Path.cwd())) # relative
import torch.nn.functional as F
import segment.val as validate # for end-of-epoch mAP import segment.val as validate # for end-of-epoch mAP
from models.experimental import attempt_load from models.experimental import attempt_load
from models.yolo import SegmentationModel from models.yolo import SegmentationModel
......
...@@ -11,6 +11,7 @@ from utils.plots import Annotator, colors ...@@ -11,6 +11,7 @@ from utils.plots import Annotator, colors
try: try:
import clearml import clearml
from clearml import Dataset, Task from clearml import Dataset, Task
assert hasattr(clearml, '__version__') # verify package import not local dir assert hasattr(clearml, '__version__') # verify package import not local dir
except (ImportError, AssertionError): except (ImportError, AssertionError):
clearml = None clearml = None
......
...@@ -14,7 +14,7 @@ ROOT = FILE.parents[3] # YOLOv5 root directory ...@@ -14,7 +14,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 train import parse_opt, train from train import train
from utils.callbacks import Callbacks from utils.callbacks import Callbacks
from utils.general import increment_path from utils.general import increment_path
from utils.torch_utils import select_device from utils.torch_utils import select_device
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论