Commit
·
86e57da
1
Parent(s):
841fc1b
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import numpy as np
|
2 |
+
|
3 |
+
import gradio as gr
|
4 |
+
from onnx import hub
|
5 |
+
import onnxruntime as ort
|
6 |
+
import onnx
|
7 |
+
|
8 |
+
def snap(image, video):
|
9 |
+
onnx_model = onnx.load("M-Raw.onnx")
|
10 |
+
text = onnx.checker.check_model(onnx_model)
|
11 |
+
print("The model is checked")
|
12 |
+
return [image, text]
|
13 |
+
|
14 |
+
|
15 |
+
demo = gr.Interface(
|
16 |
+
snap,
|
17 |
+
[gr.Image(source="webcam", tool=None, streaming=True)],
|
18 |
+
["image", "text"],
|
19 |
+
)
|
20 |
+
|
21 |
+
if __name__ == "__main__":
|
22 |
+
demo.launch()
|