vCLR / app.py
allencbzhang's picture
Update app.py
a109861 verified
raw
history blame
824 Bytes
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)