Spaces:
Runtime error
Runtime error
Commit
·
57108a3
1
Parent(s):
07b24d4
Update app.py
Browse files
app.py
CHANGED
@@ -19,12 +19,10 @@ os.system('git clone https://github.com/WongKinYiu/yolov7')
|
|
19 |
|
20 |
#model='best'
|
21 |
def Custom_detect(img,mode):
|
22 |
-
if mode=='
|
23 |
model='best'
|
24 |
-
|
25 |
-
|
26 |
-
if mode=='Yolov7-model-detection':
|
27 |
-
model='yolov7'
|
28 |
|
29 |
parser = argparse.ArgumentParser()
|
30 |
parser.add_argument('--weights', nargs='+', type=str, default=model+".pt", help='model.pt path(s)')
|
@@ -159,7 +157,7 @@ def Custom_detect(img,mode):
|
|
159 |
return Image.fromarray(im0[:,:,::-1])
|
160 |
inp = gr.Image(type="pil")
|
161 |
#"Custom-Detection","Yolov7-model-detection"
|
162 |
-
inp2= gr.Dropdown(choices=['
|
163 |
output = gr.Image(type="pil")
|
164 |
|
165 |
examples=[["Examples/Image1.jpg","Image1"],["Examples/Image2.jpg","Image2"]]
|
|
|
19 |
|
20 |
#model='best'
|
21 |
def Custom_detect(img,mode):
|
22 |
+
if mode=='Yolov7':
|
23 |
model='best'
|
24 |
+
if mode=='Yolov7_tiny':
|
25 |
+
model='tiny'
|
|
|
|
|
26 |
|
27 |
parser = argparse.ArgumentParser()
|
28 |
parser.add_argument('--weights', nargs='+', type=str, default=model+".pt", help='model.pt path(s)')
|
|
|
157 |
return Image.fromarray(im0[:,:,::-1])
|
158 |
inp = gr.Image(type="pil")
|
159 |
#"Custom-Detection","Yolov7-model-detection"
|
160 |
+
inp2= gr.Dropdown(choices=['Yolov7','Yolov7_tiny'])
|
161 |
output = gr.Image(type="pil")
|
162 |
|
163 |
examples=[["Examples/Image1.jpg","Image1"],["Examples/Image2.jpg","Image2"]]
|