Add random time internval wait to seem like its thinking
Browse files
app.py
CHANGED
|
@@ -2,6 +2,9 @@ import gradio as gr
|
|
| 2 |
import glob
|
| 3 |
|
| 4 |
def classify_image(image):
|
|
|
|
|
|
|
|
|
|
| 5 |
# This function just returns "Not a bird" for any input image
|
| 6 |
return "Not a bird"
|
| 7 |
|
|
@@ -15,6 +18,8 @@ demo = gr.Interface(
|
|
| 15 |
inputs="image", # The input type is an image
|
| 16 |
outputs="text", # The output type is text
|
| 17 |
examples=examples # Add example images
|
|
|
|
|
|
|
| 18 |
)
|
| 19 |
# Launch the app
|
| 20 |
demo.launch()
|
|
|
|
| 2 |
import glob
|
| 3 |
|
| 4 |
def classify_image(image):
|
| 5 |
+
# Wait for a random interval between 0.5 and 1.5 seconds to look useful
|
| 6 |
+
time.sleep(random.uniform(0.5, 1.5))
|
| 7 |
+
|
| 8 |
# This function just returns "Not a bird" for any input image
|
| 9 |
return "Not a bird"
|
| 10 |
|
|
|
|
| 18 |
inputs="image", # The input type is an image
|
| 19 |
outputs="text", # The output type is text
|
| 20 |
examples=examples # Add example images
|
| 21 |
+
title="Is this a picture of a bird?", # Title of the app
|
| 22 |
+
description="Uses the latest in machine learning LLM Diffusion models to analyzes every pixel (twice) and to determine conclusively if it is a picture of a bird" # Description of the app
|
| 23 |
)
|
| 24 |
# Launch the app
|
| 25 |
demo.launch()
|