Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,6 +12,7 @@ SESSION_TOKEN='IQoJb3JpZ2luX2VjENb//////////wEaCXVzLXdlc3QtMiJIMEYCIQDYWsAhaEVjs
|
|
| 12 |
s3_client = boto3.client('s3', aws_access_key_id=ACCESS_KEY, aws_secret_access_key=SECRET_KEY, aws_session_token=SESSION_TOKEN)
|
| 13 |
rekognition = boto3.client('rekognition', region_name='us-east-1', aws_access_key_id=ACCESS_KEY, aws_secret_access_key=SECRET_KEY, aws_session_token=SESSION_TOKEN)
|
| 14 |
s3BucketName = 'eac5'
|
|
|
|
| 15 |
|
| 16 |
def procesar(input_image):
|
| 17 |
|
|
@@ -83,14 +84,7 @@ with gr.Blocks() as demo:
|
|
| 83 |
with gr.Column():
|
| 84 |
image_input = gr.Image(type='filepath')
|
| 85 |
with gr.Row():
|
| 86 |
-
examples = gr.Examples(
|
| 87 |
-
examples=[
|
| 88 |
-
image1,
|
| 89 |
-
image2,
|
| 90 |
-
"biblioteca.jpg"
|
| 91 |
-
],
|
| 92 |
-
inputs=[image_input], fn=procesar, outputs=[text_output, image_input]
|
| 93 |
-
)
|
| 94 |
upload_button = gr.UploadButton("Use your own image", file_types=["image"], file_count="single")
|
| 95 |
with gr.Column():
|
| 96 |
text_output.render()
|
|
|
|
| 12 |
s3_client = boto3.client('s3', aws_access_key_id=ACCESS_KEY, aws_secret_access_key=SECRET_KEY, aws_session_token=SESSION_TOKEN)
|
| 13 |
rekognition = boto3.client('rekognition', region_name='us-east-1', aws_access_key_id=ACCESS_KEY, aws_secret_access_key=SECRET_KEY, aws_session_token=SESSION_TOKEN)
|
| 14 |
s3BucketName = 'eac5'
|
| 15 |
+
rutes = ["biblioteca.jpg", "skyline_tarragona.jpg"]
|
| 16 |
|
| 17 |
def procesar(input_image):
|
| 18 |
|
|
|
|
| 84 |
with gr.Column():
|
| 85 |
image_input = gr.Image(type='filepath')
|
| 86 |
with gr.Row():
|
| 87 |
+
examples = gr.Examples(rutes, inputs=[image_input], fn=procesar, outputs=[text_output, image_input], cache_examples=True, label="Choose a sample image")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
upload_button = gr.UploadButton("Use your own image", file_types=["image"], file_count="single")
|
| 89 |
with gr.Column():
|
| 90 |
text_output.render()
|