Updated Segmentation and Classification usage (#9607)

* Updated Segmentation and Classification usage

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update export.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update export.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update export.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Glenn Jocher authored and GitHub committed 2022-09-26 20:10:24 +02:00
1 parent c4c0ee8fc3
commit a5748e4b93
1 file changed
+9 -2
+9 -2
View File
@@ -560,13 +560,20 @@ def run(
# Finish
f = [str(x) for x in f if x] # filter out '' and None
if any(f):
tp = type(model)
dir = Path('segment' if tp is SegmentationModel else 'classify' if tp is ClassificationModel else '')
predict = 'detect.py' if tp is DetectionModel else 'predict.py'
h = '--half' if half else '' # --half FP16 inference arg
LOGGER.info(f'\nExport complete ({time.time() - t:.1f}s)'
f"\nResults saved to {colorstr('bold', file.parent.resolve())}"
f"\nDetect: python detect.py --weights {f[-1]} {h}"
f"\nValidate: python val.py --weights {f[-1]} {h}"
f"\nDetect: python {dir / predict} --weights {f[-1]} {h}"
f"\nValidate: python {dir / 'val.py'} --weights {f[-1]} {h}"
f"\nPyTorch Hub: model = torch.hub.load('ultralytics/yolov5', 'custom', '{f[-1]}')"
f"\nVisualize: https://netron.app")
if tp is ClassificationModel:
LOGGER.warning("WARNING ⚠️ ClassificationModel not yet supported for PyTorch Hub AutoShape inference")
if tp is SegmentationModel:
LOGGER.warning("WARNING ⚠️ SegmentationModel not yet supported for PyTorch Hub AutoShape inference")
return f # return list of exported files/dirs