Spaces:
Running
on
Zero
Running
on
Zero
File size: 824 Bytes
a109861 68aee5f 1265529 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
import os
os.system("pip install git+https://github.com/facebookresearch/detectron2.git")
os.system("pip install git+https://github.com/Visual-AI/Mr.DETR.git")
import gradio as gr
if __name__ == "__main__":
gr.close_all()
def inference(img, confidence):
print(type(img))
return img
# img = np.array(img)
# _, results = vis_demo.run_on_image(img, confidence)
return results
demo = gr.Interface(
fn=inference,
inputs=[
gr.Image(type="pil", image_mode="RGB"),
gr.Number(precision=2, minimum=0.0, maximum=1.0, value=0.5)
],
outputs="image",
# examples=[
# ["assets/000000014226.jpg"],
# ["assets/000000028449.jpg"]
# ]
)
demo.launch(share=True, debug=False) |