output shape 600x600, different binarize
Browse files
app.py
CHANGED
@@ -36,12 +36,7 @@ config['no_aug'] = True
|
|
36 |
config['interpolation'] = 'bilinear'
|
37 |
|
38 |
# Inference function
|
39 |
-
def query_image(input_img, query, eval_threshold, crop_mode, crop_pct):
|
40 |
-
|
41 |
-
if eval_threshold == 0:
|
42 |
-
binarize = False
|
43 |
-
else:
|
44 |
-
binarize = True
|
45 |
|
46 |
if crop_mode == 'center':
|
47 |
crop_mode = None
|
@@ -101,10 +96,10 @@ the model will binarize each propability based on set eval_threshold.
|
|
101 |
demo = gr.Interface(
|
102 |
query_image,
|
103 |
#inputs=[gr.Image(), "text", "checkbox", gr.Slider(0, 1, value=0.25)],
|
104 |
-
inputs=[gr.Image(type='numpy', label='input_img').style(height=200, width=600), "text", gr.Slider(0, 1, value=0.25),
|
105 |
gr.Radio(["center", "squash", "border"], label='crop_mode'), gr.Slider(0, 1, value=1)],
|
106 |
#outputs="image",
|
107 |
-
outputs=gr.Image(type='numpy', label='output').style(height=
|
108 |
title="Object Detection Using Textual Queries",
|
109 |
description=description,
|
110 |
examples=[
|
|
|
36 |
config['interpolation'] = 'bilinear'
|
37 |
|
38 |
# Inference function
|
39 |
+
def query_image(input_img, query, binarize, eval_threshold, crop_mode, crop_pct):
|
|
|
|
|
|
|
|
|
|
|
40 |
|
41 |
if crop_mode == 'center':
|
42 |
crop_mode = None
|
|
|
96 |
demo = gr.Interface(
|
97 |
query_image,
|
98 |
#inputs=[gr.Image(), "text", "checkbox", gr.Slider(0, 1, value=0.25)],
|
99 |
+
inputs=[gr.Image(type='numpy', label='input_img').style(height=200, width=600), "text", "checkbox", gr.Slider(0, 1, value=0.25),
|
100 |
gr.Radio(["center", "squash", "border"], label='crop_mode'), gr.Slider(0, 1, value=1)],
|
101 |
#outputs="image",
|
102 |
+
outputs=gr.Image(type='numpy', label='output').style(height=610, width=600),
|
103 |
title="Object Detection Using Textual Queries",
|
104 |
description=description,
|
105 |
examples=[
|