File size: 846 Bytes
bd430c2
6eaf9f2
7cc14bc
9ece096
b3ce859
 
4765ec5
ef84569
a64df2e
3938920
4233cde
4947181
3938920
 
3f6c727
3938920
 
77664ae
3938920
bd430c2
48e6ba5
757f55b
 
c9ceede
bd430c2
77664ae
0341cbc
4765ec5
 
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
30
import gradio as gr
import os

os.system('git clone https://github.com/WongKinYiu/yolov7')


def detect(inp):
  os.system('python yolov7/detect.py --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/exp/*"
   
  #f"./yolov7/runs/detect/exp/{otp}"
  
  
  


 
  

inp = gr.inputs.Image(type="filepath", label="Input")
#output=gr.outputs.Image(type="pil", label="Output Image")
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"]])
#,examples=["Examples/img-300_jpg.rf.6b7b035dff1cda092ce3dc22be8d0135.jpg"]
io.launch(debug=True,share=False)