pharmapsychotic commited on
Commit
bf8293f
1 Parent(s): 3747795

Examples for Analyze tab, set concurrency_count to 2

Browse files
Files changed (1) hide show
  1. app.py +13 -1
app.py CHANGED
@@ -176,6 +176,18 @@ def analyze_tab():
176
  movement = gr.Label(label="Movement", num_top_classes=5)
177
  trending = gr.Label(label="Trending", num_top_classes=5)
178
  flavor = gr.Label(label="Flavor", num_top_classes=5)
 
 
 
 
 
 
 
 
 
 
 
 
179
  button = gr.Button("Analyze", api_name="image-analysis")
180
  button.click(image_analysis, inputs=[image, model], outputs=[medium, artist, movement, trending, flavor])
181
 
@@ -220,4 +232,4 @@ with gr.Blocks(css=CSS) as block:
220
  )
221
  share_button.click(None, [], [], _js=share_js)
222
 
223
- block.queue(max_size=64).launch(show_api=False)
 
176
  movement = gr.Label(label="Movement", num_top_classes=5)
177
  trending = gr.Label(label="Trending", num_top_classes=5)
178
  flavor = gr.Label(label="Flavor", num_top_classes=5)
179
+
180
+ examples=[['example01.jpg', MODELS[0]], ['example02.jpg', MODELS[0]]]
181
+ ex = gr.Examples(
182
+ examples=examples,
183
+ fn=image_analysis,
184
+ inputs=[input_image, input_model],
185
+ outputs=[medium, artist, movement, trending, flavor],
186
+ cache_examples=True,
187
+ run_on_click=True
188
+ )
189
+ ex.dataset.headers = [""]
190
+
191
  button = gr.Button("Analyze", api_name="image-analysis")
192
  button.click(image_analysis, inputs=[image, model], outputs=[medium, artist, movement, trending, flavor])
193
 
 
232
  )
233
  share_button.click(None, [], [], _js=share_js)
234
 
235
+ block.queue(max_size=64, concurrency_count=2).launch(show_api=False)