gherget commited on
Commit
63f30af
1 Parent(s): c94e841

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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
- #json.dumps(outputs["instances"])
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 reponse 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.Textbox(label="Description for using in ChatGPT", lines=5)
147
- #outputjson = gr.JSON(label="Detected Objects")
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