Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -47,12 +47,7 @@ def detect(img,model):
|
|
47 |
parser.add_argument('--trace', action='store_true', help='trace model')
|
48 |
opt = parser.parse_args()
|
49 |
img.save("Inference/test.jpg")
|
50 |
-
|
51 |
-
opt.img_size=640
|
52 |
-
source, weights, view_img, save_txt, imgsz, trace = opt.source, opt.weights, opt.view_img, opt.save_txt, opt.img_size, opt.trace
|
53 |
-
if model == "yolov7-e6e" or "yolov7-e6":
|
54 |
-
opt.img_size=1280
|
55 |
-
source, weights, view_img, save_txt, imgsz, trace = opt.source, opt.weights, opt.view_img, opt.save_txt, opt.img_size, opt.trace
|
56 |
save_img = True # save inference images
|
57 |
webcam = source.isnumeric() or source.endswith('.txt') or source.lower().startswith(
|
58 |
('rtsp://', 'rtmp://', 'http://', 'https://'))
|
@@ -188,4 +183,4 @@ def detect(img,model):
|
|
188 |
return Image.fromarray(im0[:,:,::-1])
|
189 |
|
190 |
|
191 |
-
gr.Interface(detect,[gr.Image(type="pil"),gr.Dropdown(choices=["yolov7","yolov7-
|
|
|
47 |
parser.add_argument('--trace', action='store_true', help='trace model')
|
48 |
opt = parser.parse_args()
|
49 |
img.save("Inference/test.jpg")
|
50 |
+
source, weights, view_img, save_txt, imgsz, trace = opt.source, opt.weights, opt.view_img, opt.save_txt, opt.img_size, opt.trace
|
|
|
|
|
|
|
|
|
|
|
51 |
save_img = True # save inference images
|
52 |
webcam = source.isnumeric() or source.endswith('.txt') or source.lower().startswith(
|
53 |
('rtsp://', 'rtmp://', 'http://', 'https://'))
|
|
|
183 |
return Image.fromarray(im0[:,:,::-1])
|
184 |
|
185 |
|
186 |
+
gr.Interface(detect,[gr.Image(type="pil"),gr.Dropdown(choices=["yolov7","yolov7-e6"])], gr.Image(type="pil"),title="Yolov7",examples=[["horses.jpeg", "yolov7"]],description="demo for <a href='https://github.com/WongKinYiu/yolov7' style='text-decoration: underline' target='_blank'>WongKinYiu/yolov7</a> Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors").launch()
|