File size: 442 Bytes
e0ad1ce
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19


import os

import gradio as gr
from gradio_carousel import Carousel

image_dir = os.path.join(os.path.dirname(__file__), "alligator_images")

images = [os.path.join(image_dir, file) for file in os.listdir(image_dir) if file.endswith((".jpg", ".jpeg", ".png"))]

with gr.Blocks() as demo:
    with gr.Row():
        Carousel(label="cool gators", value=images)  # carousel component with images


if __name__ == "__main__":
    demo.launch()