gherget commited on
Commit
0a7a87a
1 Parent(s): 6deaf33

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -7
app.py CHANGED
@@ -109,8 +109,8 @@ def inference(img,unique_only):
109
  "prediction": predicted_label,
110
  "x": int(x0),
111
  "y": int(y0),
112
- "w": int(width),
113
- "h": int(height),
114
  }
115
  )
116
  if ((not unique_only) or (unique_only and predicted_label not in unique_object_dict)):
@@ -131,16 +131,12 @@ def inference(img,unique_only):
131
 
132
 
133
  with gr.Blocks() as demo:
134
- gr.Markdown("<div style=\"font-size:22; color: #2f2f2f; text-align: center\"><b>Detic for ChatGPT</b></div> <i>")
135
- gr.Markdown("<div style=\"font-size:12; color: #6f6f6f; text-align: center\"><i>A duplicated tweak of <a href=\"https://huggingface.co/spaces/taesiri/DeticChatGPT\">taesiri's Dectic/ChatGPT demo</a></i>")
136
- gr.Markdown("Use Detic to detect objects in an image and then copy/paste output text into your ChatGPT playground.")
137
-
138
  with gr.Column():
139
  inp = gr.Image(label="Input Image", type="filepath")
140
  chk = gr.Checkbox(label="Unique Objects only? (useful to reduce ChatGPT input to speed up its reponse and also eliminate timeouts")
141
  btn_detic = gr.Button("Run Detic for ChatGPT")
142
  with gr.Column():
143
- outviz = gr.Image(label="Visualization", type="pil")
144
  output_desc = gr.Textbox(label="Description for using in ChatGPT", lines=5)
145
  # outputjson = gr.JSON(label="Detected Objects")
146
 
 
109
  "prediction": predicted_label,
110
  "x": int(x0),
111
  "y": int(y0),
112
+ "width": int(width),
113
+ "height": int(height),
114
  }
115
  )
116
  if ((not unique_only) or (unique_only and predicted_label not in unique_object_dict)):
 
131
 
132
 
133
  with gr.Blocks() as demo:
 
 
 
 
134
  with gr.Column():
135
  inp = gr.Image(label="Input Image", type="filepath")
136
  chk = gr.Checkbox(label="Unique Objects only? (useful to reduce ChatGPT input to speed up its reponse and also eliminate timeouts")
137
  btn_detic = gr.Button("Run Detic for ChatGPT")
138
  with gr.Column():
139
+ #outviz = gr.Image(label="Visualization", type="pil")
140
  output_desc = gr.Textbox(label="Description for using in ChatGPT", lines=5)
141
  # outputjson = gr.JSON(label="Detected Objects")
142