miguelflores-0906's picture
Update app.py
b70ebda
raw
history blame
510 Bytes
import numpy as np
import gradio as gr
from onnx import hub
import onnxruntime as ort
import onnx
def snap(image, video):
onnx_model = onnx.load("M-Raw.onnx")
text = onnx.checker.check_model(onnx_model)
print("The model is checked")
ort_sess = ort.InferenceSession(onnx_model)
output = ort_sess.run(None, image)
return [output]
demo = gr.Interface(
snap,
[gr.Image(source="webcam", tool=None, streaming=True)],
["image"],
)
if __name__ == "__main__":
demo.launch()