Update app.py
Browse files
app.py
CHANGED
@@ -131,20 +131,20 @@ def inference(img,unique_only):
|
|
131 |
|
132 |
return (
|
133 |
#Image.fromarray(np.uint8(out.get_image())).convert("RGB"),
|
134 |
-
json.dumps(detected_objects)
|
135 |
-
|
136 |
)
|
137 |
|
138 |
|
139 |
with gr.Blocks() as demo:
|
140 |
with gr.Column():
|
141 |
inp = gr.Image(label="Input Image", type="filepath")
|
142 |
-
chk = gr.Checkbox(label="Unique Objects only? (useful to reduce ChatGPT input to speed up its
|
143 |
btn_detic = gr.Button("Run Detic for ChatGPT")
|
144 |
with gr.Column():
|
145 |
#outviz = gr.Image(label="Visualization", type="pil")
|
146 |
-
output_desc = gr.
|
147 |
-
|
148 |
|
149 |
btn_detic.click(fn=inference, inputs=[inp,chk], outputs=[output_desc], api_name="detect")
|
150 |
|
|
|
131 |
|
132 |
return (
|
133 |
#Image.fromarray(np.uint8(out.get_image())).convert("RGB"),
|
134 |
+
json.dumps(detected_objects),
|
135 |
+
json.dumps(masks_screen)
|
136 |
)
|
137 |
|
138 |
|
139 |
with gr.Blocks() as demo:
|
140 |
with gr.Column():
|
141 |
inp = gr.Image(label="Input Image", type="filepath")
|
142 |
+
chk = gr.Checkbox(label="Unique Objects only? (useful to reduce ChatGPT input to speed up its response and also eliminate timeouts")
|
143 |
btn_detic = gr.Button("Run Detic for ChatGPT")
|
144 |
with gr.Column():
|
145 |
#outviz = gr.Image(label="Visualization", type="pil")
|
146 |
+
output_desc = gr.JSON(label="Detected Objects")
|
147 |
+
masks = gr.JSON(label="Masks")
|
148 |
|
149 |
btn_detic.click(fn=inference, inputs=[inp,chk], outputs=[output_desc], api_name="detect")
|
150 |
|