Link fuse() to AutoShape() for Hub models (#8599)
This commit is contained in:
1 parent
6e86af3de8
commit
a34b376d0f
2 files changed
+3
-4
No files matched your search
+1
-2
@@ -36,7 +36,6 @@ def _create(name, pretrained=True, channels=3, classes=80, autoshape=True, verbo
|
||||
|
||||
if not verbose:
|
||||
LOGGER.setLevel(logging.WARNING)
|
||||
|
||||
check_requirements(exclude=('tensorboard', 'thop', 'opencv-python'))
|
||||
name = Path(name)
|
||||
path = name.with_suffix('.pt') if name.suffix == '' and not name.is_dir() else name # checkpoint path
|
||||
@@ -44,7 +43,7 @@ def _create(name, pretrained=True, channels=3, classes=80, autoshape=True, verbo
|
||||
device = select_device(device)
|
||||
|
||||
if pretrained and channels == 3 and classes == 80:
|
||||
model = DetectMultiBackend(path, device=device) # download/load FP32 model
|
||||
model = DetectMultiBackend(path, device=device, fuse=autoshape) # download/load FP32 model
|
||||
# model = models.experimental.attempt_load(path, map_location=device) # download/load FP32 model
|
||||
else:
|
||||
cfg = list((Path(__file__).parent / 'models').rglob(f'{path.stem}.yaml'))[0] # model.yaml path
|
||||
|
||||
Reference in new issue
Block a user