File size: 654 Bytes
bd430c2
6eaf9f2
7cc14bc
81d0025
b3ce859
 
4765ec5
b3ce859
4947181
7cc14bc
4947181
bd430c2
48e6ba5
4947181
 
bd430c2
 
4765ec5
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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'{inp.split('/')}'
  #f"./yolov7/runs/detect/exp/{otp}"

inp = gr.inputs.Image(type="filepath", label="Input")
output = gr.outputs.Textbox()
#gr.outputs.Image(type="filepath", label="Output")


io=gr.Interface(fn=detect, inputs=inp, outputs=output, title='Pot Hole Detection With Custom YOLOv7 ',)
io.launch(debug=True,share=False)