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.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>pull/9466/head
parent
8ae81a6c87
commit
95cef1ae6b
|
@ -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
|
||||||
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
|
||||||
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
|
||||||
|
|
Loading…
Reference in New Issue