import gradio as gr from datasets import load_dataset # Load the WikiArt dataset dataset = load_dataset("huggan/wikiart") # Function to display artwork details def display_artwork(index): record = dataset["train"][index] return record["image"], f"Welcome to the Gallery\n\nTitle: {record['title']}\nArtist: {record['artist']}\nStyle: {record['style']}\nGenre: {record['genre']}\n\nStep into the world of art and explore its details." # Gradio Interface gr.Interface( fn=display_artwork, inputs=gr.Number(label="Artwork Index"), outputs=[gr.Image(label="Artwork"), gr.Text(label="Details")], title="Virtual AI Art Gallery" ).launch()