Add suffix checks (#4711)

* Add suffix checks

* Cleanup

* Cleanup2

* Cleanup3
This commit is contained in:
Glenn Jocher authored and GitHub committed 2021-09-08 14:36:12 +02:00
1 parent 8e5f9ddbdb
commit a2b3c71636
7 files changed
+41 -21

No files matched your search

+3 -3
View File
@@ -53,7 +53,7 @@ from models.common import Conv, Bottleneck, SPP, DWConv, Focus, BottleneckCSP, C
from models.experimental import MixConv2d, CrossConv, attempt_load
from models.yolo import Detect
from utils.datasets import LoadImages
from utils.general import make_divisible, check_file, check_dataset
from utils.general import check_dataset, check_yaml, make_divisible
logger = logging.getLogger(__name__)
@@ -447,7 +447,7 @@ if __name__ == "__main__":
parser.add_argument('--iou-thres', type=float, default=0.5, help='IOU threshold for NMS')
parser.add_argument('--score-thres', type=float, default=0.4, help='score threshold for NMS')
opt = parser.parse_args()
opt.cfg = check_file(opt.cfg) # check file
opt.cfg = check_yaml(opt.cfg) # check YAML
opt.img_size *= 2 if len(opt.img_size) == 1 else 1 # expand
print(opt)
@@ -534,7 +534,7 @@ if __name__ == "__main__":
if opt.tfl_int8:
# Representative Dataset
if opt.source.endswith('.yaml'):
with open(check_file(opt.source)) as f:
with open(check_yaml(opt.source)) as f:
data = yaml.load(f, Loader=yaml.FullLoader) # data dict
check_dataset(data) # check
opt.source = data['train']
+4 -4
View File
@@ -17,10 +17,10 @@ sys.path.append(FILE.parents[1].as_posix()) # add yolov5/ to path
from models.common import *
from models.experimental import *
from utils.autoanchor import check_anchor_order
from utils.general import make_divisible, check_file, set_logging
from utils.general import check_yaml, make_divisible, set_logging
from utils.plots import feature_visualization
from utils.torch_utils import time_sync, fuse_conv_and_bn, model_info, scale_img, initialize_weights, \
select_device, copy_attr
from utils.torch_utils import copy_attr, fuse_conv_and_bn, initialize_weights, model_info, scale_img, \
select_device, time_sync
try:
import thop # for FLOPs computation
@@ -281,7 +281,7 @@ if __name__ == '__main__':
parser.add_argument('--device', default='', help='cuda device, i.e. 0 or 0,1,2,3 or cpu')
parser.add_argument('--profile', action='store_true', help='profile model speed')
opt = parser.parse_args()
opt.cfg = check_file(opt.cfg) # check file
opt.cfg = check_yaml(opt.cfg) # check YAML
set_logging()
device = select_device(opt.device)