Skip to content

Commit

Permalink
Use named imports in models.yolo (#12576)
Browse files Browse the repository at this point in the history
  • Loading branch information
akx committed Jan 3, 2024
1 parent 46ae996 commit f6a781a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions models/yolo.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,29 @@

import argparse
import contextlib
import math
import os
import platform
import sys
from copy import deepcopy
from pathlib import Path

import torch
import torch.nn as nn

FILE = Path(__file__).resolve()
ROOT = FILE.parents[1] # YOLOv5 root directory
if str(ROOT) not in sys.path:
sys.path.append(str(ROOT)) # add ROOT to PATH
if platform.system() != 'Windows':
ROOT = Path(os.path.relpath(ROOT, Path.cwd())) # relative

from models.common import * # noqa
from models.experimental import * # noqa
from models.common import (C3, C3SPP, C3TR, SPP, SPPF, Bottleneck, BottleneckCSP, C3Ghost, C3x, Classify, Concat,
Contract, Conv, CrossConv, DetectMultiBackend, DWConv, DWConvTranspose2d, Expand, Focus,
GhostBottleneck, GhostConv, Proto)
from models.experimental import MixConv2d
from utils.autoanchor import check_anchor_order
from utils.general import LOGGER, check_version, check_yaml, make_divisible, print_args
from utils.general import LOGGER, check_version, check_yaml, colorstr, make_divisible, print_args
from utils.plots import feature_visualization
from utils.torch_utils import (fuse_conv_and_bn, initialize_weights, model_info, profile, scale_img, select_device,
time_sync)
Expand Down

0 comments on commit f6a781a

Please sign in to comment.