yifehuang97 commited on
Commit
2922eb9
·
1 Parent(s): 56ba6f3

adjust the layout

Browse files
Files changed (1) hide show
  1. app.py +26 -25
app.py CHANGED
@@ -134,13 +134,15 @@ def count_objects(image, pos_caption, neg_caption, box_threshold, point_radius,
134
  def create_demo():
135
  with gr.Blocks(title="CountEx: Discriminative Visual Counting") as demo:
136
  gr.Markdown("""
137
- # CountEx: Discriminative Visual Counting
138
 
139
  Count specific objects in images using positive and negative text prompts.
140
 
141
- **Positive Prompt**: Describe what you want to count (e.g., "Green Apple")
142
 
143
- **Negative Prompt**: Describe what you want to exclude (e.g., "Red Apple")
 
 
144
  """)
145
 
146
  with gr.Row():
@@ -159,28 +161,27 @@ def create_demo():
159
  value="Red Apple"
160
  )
161
 
162
- with gr.Accordion("Advanced Settings", open=False):
163
- box_threshold = gr.Slider(
164
- minimum=0.0,
165
- maximum=1.0,
166
- value=0.0,
167
- step=0.01,
168
- label="Detection Threshold (0 = use model default)"
169
- )
170
-
171
- point_radius = gr.Slider(
172
- minimum=1,
173
- maximum=20,
174
- value=5,
175
- step=1,
176
- label="Point Radius"
177
- )
178
-
179
- point_color = gr.Dropdown(
180
- choices=["blue", "red", "green", "yellow", "cyan", "magenta", "white"],
181
- value="blue",
182
- label="Point Color"
183
- )
184
 
185
  submit_btn = gr.Button("Count Objects", variant="primary")
186
 
 
134
  def create_demo():
135
  with gr.Blocks(title="CountEx: Discriminative Visual Counting") as demo:
136
  gr.Markdown("""
137
+ # CountEx: Fine-Grained Counting via Exemplars and Exclusion
138
 
139
  Count specific objects in images using positive and negative text prompts.
140
 
141
+ **Positive Prompt**: Describe what you want to count (e.g., "Green Apple.")
142
 
143
+ **Negative Prompt**: Describe what you want to exclude (e.g., "Red Apple.")
144
+
145
+ **Important Note: Both the Positive and Negative prompts must end with a period (.) for the model to correctly interpret the instruction.**
146
  """)
147
 
148
  with gr.Row():
 
161
  value="Red Apple"
162
  )
163
 
164
+ box_threshold = gr.Slider(
165
+ minimum=0.0,
166
+ maximum=1.0,
167
+ value=0.42,
168
+ step=0.01,
169
+ label="Detection Threshold (0 = use model default)"
170
+ )
171
+
172
+ point_radius = gr.Slider(
173
+ minimum=1,
174
+ maximum=20,
175
+ value=5,
176
+ step=1,
177
+ label="Point Radius"
178
+ )
179
+
180
+ point_color = gr.Dropdown(
181
+ choices=["blue", "red", "green", "yellow", "cyan", "magenta", "white"],
182
+ value="blue",
183
+ label="Point Color"
184
+ )
 
185
 
186
  submit_btn = gr.Button("Count Objects", variant="primary")
187