Skip to content

Commit fe66c12

Browse files
committed
add download_model.py
1 parent 78deea4 commit fe66c12

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from pathlib import Path
2+
from onnx import hub
3+
import onnx
4+
5+
if __name__ == "__main__":
6+
script_dir = Path(__file__).parent
7+
output_path = script_dir / "model.onnx"
8+
model_name = "MobileNet v2-1.0-fp32"
9+
10+
model = hub.load(model_name)
11+
onnx.save(model, output_path)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
onnx
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
11
Add a model here and name it model.onnx.
2+
3+
You can run `download_model.py` to obtain a model.
4+
5+
```bash
6+
python -m pip install -r ./download_model.requirements.txt
7+
8+
python ./download_model.py
9+
```
10+

0 commit comments

Comments
 (0)