Spaces:
Sleeping
Sleeping
Commit
·
31e9d90
1
Parent(s):
27b5c7e
Subindo arquivos
Browse files- app.py +4 -1
- example1.onnx +3 -0
app.py
CHANGED
@@ -5,7 +5,7 @@ import zipfile
|
|
5 |
import os
|
6 |
|
7 |
def process_onnx(uploaded_file):
|
8 |
-
# Check if the uploaded file is a zip file
|
9 |
if zipfile.is_zipfile(uploaded_file.name):
|
10 |
with zipfile.ZipFile(uploaded_file.name, 'r') as zip_ref:
|
11 |
zip_ref.extractall("/tmp")
|
@@ -44,6 +44,7 @@ def process_onnx(uploaded_file):
|
|
44 |
|
45 |
return summary_output, nodes_output
|
46 |
|
|
|
47 |
iface = gr.Interface(
|
48 |
fn=process_onnx,
|
49 |
inputs=gr.File(label="Upload .ONNX or .ZIP File"),
|
@@ -51,8 +52,10 @@ iface = gr.Interface(
|
|
51 |
gr.components.Textbox(label="Summary"),
|
52 |
gr.components.Textbox(label="Complete Nodes")
|
53 |
],
|
|
|
54 |
title="ONNX Model Scope",
|
55 |
description="Upload an ONNX file or a ZIP file containing an .onnx file to extract and display its detailed information. This process can take some time depending on the size of the ONNX model."
|
56 |
)
|
57 |
|
|
|
58 |
iface.launch(debug=True)
|
|
|
5 |
import os
|
6 |
|
7 |
def process_onnx(uploaded_file):
|
8 |
+
# Check if the uploaded file is a zip file
|
9 |
if zipfile.is_zipfile(uploaded_file.name):
|
10 |
with zipfile.ZipFile(uploaded_file.name, 'r') as zip_ref:
|
11 |
zip_ref.extractall("/tmp")
|
|
|
44 |
|
45 |
return summary_output, nodes_output
|
46 |
|
47 |
+
# Define the Gradio Interface
|
48 |
iface = gr.Interface(
|
49 |
fn=process_onnx,
|
50 |
inputs=gr.File(label="Upload .ONNX or .ZIP File"),
|
|
|
52 |
gr.components.Textbox(label="Summary"),
|
53 |
gr.components.Textbox(label="Complete Nodes")
|
54 |
],
|
55 |
+
examples=["example1.onnx"], # Add your example file here
|
56 |
title="ONNX Model Scope",
|
57 |
description="Upload an ONNX file or a ZIP file containing an .onnx file to extract and display its detailed information. This process can take some time depending on the size of the ONNX model."
|
58 |
)
|
59 |
|
60 |
+
# Launch the Interface
|
61 |
iface.launch(debug=True)
|
example1.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4c3ad7a7211aaa0760d825be9c2ed302d51990c494406b5b6dfe04021584318d
|
3 |
+
size 46827059
|