add sample models in the readme

1123
ZhangGe6 4 years ago
parent d775191211
commit 0d8a9814f9

@ -6,8 +6,8 @@ app = Flask(__name__)
def index():
return render_template('index.html')
@app.route('/return_file', methods=['POST'])
def return_file():
@app.route('/open_model', methods=['POST'])
def open_model():
# https://blog.miguelgrinberg.com/post/handling-file-uploads-with-flask
onnx_file = request.files['file']

@ -89,11 +89,21 @@ For example, Now we want remove the preprocess operators (`Sub->Mul->Sub->Trans
<img src="./docs/rename_node_io.png" alt="rename_node_io" style="zoom:60%;" />
# Sample models
For quick testing, some typical sample models are provided as following. Most of them are from [onnx model zoo](https://github.com/onnx/models)
- squeezeNet [Link (4.72MB)](https://github.com/onnx/models/blob/main/vision/classification/squeezenet/model/squeezenet1.0-12.onnx)
- MobileNet [Link (13.3MB)](https://github.com/onnx/models/blob/main/vision/classification/mobilenet/model/mobilenetv2-7.onnx)
- ResNet50-int8 [Link (24.6MB)](https://github.com/onnx/models/blob/main/vision/classification/resnet/model/resnet50-v1-12-int8.onnx)
- movenet-lightning [Link (9.01MB)](https://pan.baidu.com/s/1MVheshDu58o4AAgoR9awRQ?pwd=jub9)
- Converted from the pretrained [tflite model](https://tfhub.dev/google/movenet/singlepose/lightning/4) using [tensorflow-onnx](https://github.com/onnx/tensorflow-onnx);
- There are preprocess nodes and a big bunch of postprocessing nodes in the model.
`onnx-modifier` is under active development :hammer_and_wrench:. Welcome to use, create issues and pull requests! 🥰
# Credits and referred materials
- [Netron](https://github.com/lutzroeder/netron)
- [flask](https://github.com/pallets/flask)
- ONNX Python API [Official doc](https://github.com/onnx/onnx/blob/main/docs/PythonAPIOverview.md), [Leimao's Blog](https://leimao.github.io/blog/ONNX-Python-API/)
@ -101,3 +111,6 @@ For example, Now we want remove the preprocess operators (`Sub->Mul->Sub->Trans
- [onnx-utils](https://github.com/saurabh-shandilya/onnx-utils)
- [sweetalert](https://github.com/t4t5/sweetalert)
[https://github.com/onnx/models/blob/main/vision/classification/mobilenet/model/mobilenetv2-7.onnx]:

@ -85,10 +85,24 @@
`onnx-modifer`正在活跃地更新中:hammer_and_wrench:。 欢迎使用提issue如果有帮助的话感谢给个:star:~
# 示例模型文件
为方便测试,以下提供一些典型的样例模型文件,主要来自于[onnx model zoo](https://github.com/onnx/models)
- squeezeNet [链接 (4.72MB)](https://github.com/onnx/models/blob/main/vision/classification/squeezenet/model/squeezenet1.0-12.onnx)
- MobileNet [链接 (13.3MB)](https://github.com/onnx/models/blob/main/vision/classification/mobilenet/model/mobilenetv2-7.onnx)
- ResNet50-int8 [链接 (24.6MB)](https://github.com/onnx/models/blob/main/vision/classification/resnet/model/resnet50-v1-12-int8.onnx)
- movenet-lightning [链接 (9.01MB)](https://pan.baidu.com/s/1MVheshDu58o4AAgoR9awRQ?pwd=jub9)
- 将Google提供的预训练[tflite模型](https://tfhub.dev/google/movenet/singlepose/lightning/4),使用[tensorflow-onnx](https://github.com/onnx/tensorflow-onnx)转换得到;
- 模型中包含前处理和一大块后处理节点。
# 参考资料
- [Netron](https://github.com/lutzroeder/netron)
- [flask](https://github.com/pallets/flask)
- ONNX Python API [Official doc](https://github.com/onnx/onnx/blob/main/docs/PythonAPIOverview.md), [Leimao's Blog](https://leimao.github.io/blog/ONNX-Python-API/)
- ONNX IO Stream [Leimao's Blog](https://leimao.github.io/blog/ONNX-IO-Stream/)
- [onnx-utils](https://github.com/saurabh-shandilya/onnx-utils)
- [sweetalert](https://github.com/t4t5/sweetalert)
[https://github.com/onnx/models/blob/main/vision/classification/mobilenet/model/mobilenetv2-7.onnx]:

@ -289,7 +289,7 @@ host.BrowserHost = class {
form.append('file', file);
// https://stackoverflow.com/questions/66039996/javascript-fetch-upload-files-to-python-flask-restful
fetch('/return_file', {
fetch('/open_model', {
method: 'POST',
body: form
}).then(function (response) {

Loading…
Cancel
Save