File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -560,13 +560,20 @@ def run(
560
560
# Finish
561
561
f = [str (x ) for x in f if x ] # filter out '' and None
562
562
if any (f ):
563
+ tp = type (model )
564
+ dir = Path ('segment' if tp is SegmentationModel else 'classify' if tp is ClassificationModel else '' )
565
+ predict = 'detect.py' if tp is DetectionModel else 'predict.py'
563
566
h = '--half' if half else '' # --half FP16 inference arg
564
567
LOGGER .info (f'\n Export complete ({ time .time () - t :.1f} s)'
565
568
f"\n Results saved to { colorstr ('bold' , file .parent .resolve ())} "
566
- f"\n Detect: python detect.py --weights { f [- 1 ]} { h } "
567
- f"\n Validate: python val.py --weights { f [- 1 ]} { h } "
569
+ f"\n Detect: python { dir / predict } --weights { f [- 1 ]} { h } "
570
+ f"\n Validate: python { dir / ' val.py' } --weights { f [- 1 ]} { h } "
568
571
f"\n PyTorch Hub: model = torch.hub.load('ultralytics/yolov5', 'custom', '{ f [- 1 ]} ')"
569
572
f"\n Visualize: https://netron.app" )
573
+ if tp is ClassificationModel :
574
+ LOGGER .warning ("WARNING ⚠️ ClassificationModel not yet supported for PyTorch Hub AutoShape inference" )
575
+ if tp is SegmentationModel :
576
+ LOGGER .warning ("WARNING ⚠️ SegmentationModel not yet supported for PyTorch Hub AutoShape inference" )
570
577
return f # return list of exported files/dirs
571
578
572
579
You can’t perform that action at this time.
0 commit comments