Spaces:
Sleeping
Sleeping
Commit
·
fab33c4
1
Parent(s):
cd5db6b
Updated device
Browse files
app.py
CHANGED
@@ -34,7 +34,7 @@ def resize_image_pil(image, new_width, new_height):
|
|
34 |
def inference(input_img, conf_thres, iou_thres):
|
35 |
im0 = input_img.copy()
|
36 |
# Load model
|
37 |
-
device = select_device(
|
38 |
model = DetectMultiBackend(weights, device=device, dnn=False, data=data, fp16=False)
|
39 |
stride, names, pt = model.stride, model.names, model.pt
|
40 |
imgsz = check_img_size(imgsz, s=stride) # check image size
|
@@ -90,4 +90,6 @@ demo = gr.Interface(inference,
|
|
90 |
outputs= [gr.Image(width=640, height=640, label="Output")],
|
91 |
title=title,
|
92 |
description=description,
|
93 |
-
examples=examples)
|
|
|
|
|
|
34 |
def inference(input_img, conf_thres, iou_thres):
|
35 |
im0 = input_img.copy()
|
36 |
# Load model
|
37 |
+
device = select_device('cpu')
|
38 |
model = DetectMultiBackend(weights, device=device, dnn=False, data=data, fp16=False)
|
39 |
stride, names, pt = model.stride, model.names, model.pt
|
40 |
imgsz = check_img_size(imgsz, s=stride) # check image size
|
|
|
90 |
outputs= [gr.Image(width=640, height=640, label="Output")],
|
91 |
title=title,
|
92 |
description=description,
|
93 |
+
examples=examples)
|
94 |
+
|
95 |
+
demo.launch()
|