gradio_carousel / app.py
hmb's picture
hmb HF staff
Upload folder using huggingface_hub
e0ad1ce verified
raw
history blame
442 Bytes
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()