Refactor argparser printing to print_args() (#4850)
* Refactor argparser printing to `print_args()` * Cleanup
This commit is contained in:
1 parent
84bfa89236
commit
3732f9ac8a
6 files changed
+23
-18
No files matched your search
+3
-3
@@ -27,9 +27,9 @@ import torch.nn as nn
|
||||
from tensorflow import keras
|
||||
|
||||
from models.common import Conv, Bottleneck, SPP, DWConv, Focus, BottleneckCSP, Concat, autopad, C3
|
||||
from models.experimental import MixConv2d, CrossConv, attempt_load
|
||||
from models.experimental import CrossConv, MixConv2d, attempt_load
|
||||
from models.yolo import Detect
|
||||
from utils.general import colorstr, make_divisible, set_logging
|
||||
from utils.general import make_divisible, print_args, set_logging
|
||||
from utils.activations import SiLU
|
||||
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
@@ -434,12 +434,12 @@ def parse_opt():
|
||||
parser.add_argument('--dynamic', action='store_true', help='dynamic batch size')
|
||||
opt = parser.parse_args()
|
||||
opt.imgsz *= 2 if len(opt.imgsz) == 1 else 1 # expand
|
||||
print_args(FILE.stem, opt)
|
||||
return opt
|
||||
|
||||
|
||||
def main(opt):
|
||||
set_logging()
|
||||
print(colorstr('tf.py: ') + ', '.join(f'{k}={v}' for k, v in vars(opt).items()))
|
||||
run(**vars(opt))
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user