glenn-jocher
commited on
Add `export.py` ONNX inference suggestion (#4146)
Browse files
export.py
CHANGED
@@ -76,6 +76,7 @@ def export_onnx(model, img, file, opset, train, dynamic, simplify):
|
|
76 |
except Exception as e:
|
77 |
print(f'{prefix} simplifier failure: {e}')
|
78 |
print(f'{prefix} export success, saved as {f} ({file_size(f):.1f} MB)')
|
|
|
79 |
except Exception as e:
|
80 |
print(f'{prefix} export failure: {e}')
|
81 |
|
@@ -94,7 +95,7 @@ def export_coreml(model, img, file):
|
|
94 |
model.save(f)
|
95 |
print(f'{prefix} export success, saved as {f} ({file_size(f):.1f} MB)')
|
96 |
except Exception as e:
|
97 |
-
print(f'{prefix} export failure: {e}')
|
98 |
|
99 |
|
100 |
def run(weights='./yolov5s.pt', # weights path
|
|
|
76 |
except Exception as e:
|
77 |
print(f'{prefix} simplifier failure: {e}')
|
78 |
print(f'{prefix} export success, saved as {f} ({file_size(f):.1f} MB)')
|
79 |
+
print(f"{prefix} run --dynamic ONNX model inference with detect.py: 'python detect.py --weights {f}'")
|
80 |
except Exception as e:
|
81 |
print(f'{prefix} export failure: {e}')
|
82 |
|
|
|
95 |
model.save(f)
|
96 |
print(f'{prefix} export success, saved as {f} ({file_size(f):.1f} MB)')
|
97 |
except Exception as e:
|
98 |
+
print(f'\n{prefix} export failure: {e}')
|
99 |
|
100 |
|
101 |
def run(weights='./yolov5s.pt', # weights path
|