Spaces:
Sleeping
Sleeping
cheng
commited on
Commit
·
5d9e3f9
1
Parent(s):
863c45d
update Image
Browse files- app.py +2 -3
- grounding_component.py +1 -1
app.py
CHANGED
@@ -23,10 +23,9 @@ if __name__ == "__main__":
|
|
23 |
input_image = gr.Image(source='upload', type="numpy", label="Please upload a food picture.")
|
24 |
run_button = gr.Button(value="Detect", variant="primary")
|
25 |
with gr.Column():
|
26 |
-
|
27 |
-
grid=(1, 1), preview=False, object_fit="none")
|
28 |
|
29 |
run_button.click(fn=detect, inputs=[
|
30 |
-
input_image], outputs=[
|
31 |
|
32 |
detect_app.launch(share=False, show_api=False, show_error=True)
|
|
|
23 |
input_image = gr.Image(source='upload', type="numpy", label="Please upload a food picture.")
|
24 |
run_button = gr.Button(value="Detect", variant="primary")
|
25 |
with gr.Column():
|
26 |
+
output_image = gr.Image(label="Detection Results",show_download_button=True,)
|
|
|
27 |
|
28 |
run_button.click(fn=detect, inputs=[
|
29 |
+
input_image], outputs=[output_image])
|
30 |
|
31 |
detect_app.launch(share=False, show_api=False, show_error=True)
|
grounding_component.py
CHANGED
@@ -61,7 +61,7 @@ def run_grounding(input_image, describe):
|
|
61 |
pil_img = Image.fromarray(input_image)
|
62 |
init_image = pil_img.convert("RGB")
|
63 |
grounding_caption = describe
|
64 |
-
box_threshold = 0.
|
65 |
text_threshold = 0.25
|
66 |
|
67 |
_, image_tensor = image_transform_grounding(init_image)
|
|
|
61 |
pil_img = Image.fromarray(input_image)
|
62 |
init_image = pil_img.convert("RGB")
|
63 |
grounding_caption = describe
|
64 |
+
box_threshold = 0.3
|
65 |
text_threshold = 0.25
|
66 |
|
67 |
_, image_tensor = image_transform_grounding(init_image)
|