Spaces:
Running
on
T4
Running
on
T4
AAAAAAyq
commited on
Commit
·
77f39b8
1
Parent(s):
37773b6
Update app.py
Browse files
app.py
CHANGED
@@ -57,7 +57,7 @@ def fast_show_mask(annotation, ax):
|
|
57 |
|
58 |
# post_process(results[0].masks, Image.open("../data/cake.png"))
|
59 |
|
60 |
-
def predict(input, input_size):
|
61 |
input_size = int(input_size) # 确保 imgsz 是整数
|
62 |
results = model(input, device='cpu', retina_masks=True, iou=0.7, conf=0.25, imgsz=input_size)
|
63 |
pil_image = fast_process(annotations=results[0].masks.data.numpy(), image=input)
|
@@ -71,7 +71,7 @@ def predict(input, input_size):
|
|
71 |
# post_process(annotations=results, image_path=inp)
|
72 |
|
73 |
demo = gr.Interface(fn=predict,
|
74 |
-
inputs=[gr.inputs.Image(type='pil'), gr.inputs.Dropdown(choices=[512, 800, 1024], default=
|
75 |
outputs=['plot'],
|
76 |
examples=[["assets/sa_8776.jpg", 1024]],
|
77 |
# ["assets/sa_1309.jpg", 1024]],
|
|
|
57 |
|
58 |
# post_process(results[0].masks, Image.open("../data/cake.png"))
|
59 |
|
60 |
+
def predict(input, input_size=512):
|
61 |
input_size = int(input_size) # 确保 imgsz 是整数
|
62 |
results = model(input, device='cpu', retina_masks=True, iou=0.7, conf=0.25, imgsz=input_size)
|
63 |
pil_image = fast_process(annotations=results[0].masks.data.numpy(), image=input)
|
|
|
71 |
# post_process(annotations=results, image_path=inp)
|
72 |
|
73 |
demo = gr.Interface(fn=predict,
|
74 |
+
inputs=[gr.inputs.Image(type='pil'), gr.inputs.Dropdown(choices=[512, 800, 1024], default=512)],
|
75 |
outputs=['plot'],
|
76 |
examples=[["assets/sa_8776.jpg", 1024]],
|
77 |
# ["assets/sa_1309.jpg", 1024]],
|