Sa-m's picture
Update app.py
0341cbc
raw
history blame
763 Bytes
import gradio as gr
import os
os.system('git clone https://github.com/WongKinYiu/yolov7.git')
def detect(inp):
os.system('python ./yolov7/detect.py --weights ./yolov7/runs/train/yolov7/weights/best.pt --conf 0.25 --img-size 640 --source f{inp} "--project","./yolov7/runs/detect ')
otp=inp.split('/')[2]
return f"./yolov7/runs/detect/exp2/*"
#f"{inp.split('/')[2]}"
#f"./yolov7/runs/detect/exp/{otp}"
inp = gr.inputs.Image(type="filepath", label="Input")
output = gr.outputs.Image(type="filepath", label="Output")
#.outputs.Textbox()
io=gr.Interface(fn=detect, inputs=inp, outputs=output, title='Pot Hole Detection With Custom YOLOv7 ')
#,examples=["Examples/img-300_jpg.rf.6b7b035dff1cda092ce3dc22be8d0135.jpg"]
io.launch(debug=True,share=False)