import gradio as gr from GameMode import game_block from UploadMode import upload_interface # Detailed introduction and story for the application intro = """ Dive into a world of stardom with two exciting modes of interaction: **Game Mode** and **Upload Mode**. Whether you want to challenge yourself with a fun game or simply upload a picture to identify celebrities, we've got you covered! ### ๐Ÿš€ Modes of Interaction: 1. **๐ŸŽฎ Game Mode** - Test your celebrity knowledge by identifying a specific target celebrity from a crowd. Guess correctly to win! 2. **๐Ÿ“ค Upload Mode** - Upload any image containing celebrities, and our app will identify and display the names of those stars for you. ### ๐ŸŒŸ List of Celebrities: Akshay Kumar Alexandra Daddario Alia Bhatt Amitabh Bachchan Andy Samberg Anushka Sharma Billie Eilish Brad Pitt Camila Cabello Charlize Theron Claire Holt Courtney Cox Dwayne Johnson Elizabeth Olsen Ellen Degeneres Henry Cavill Hrithik Roshan Hugh Jackman Jessica Alba Lisa Kudrow Margot Robbie Natalie Portman Priyanka Chopra Robert Downey Jr Roger Federer Tom Cruise Vijay Deverakonda Virat Kohli Zac Efron **Note:** ๐Ÿ”„ *If you encounter an error, please refresh the page.* """ # Detailed self-introduction and story for each mode game_mode_intro = """ ## ๐ŸŽฎ Game Mode: The Celebrity Challenge Upload an image of celebrity to win! **Story**: ๐ŸŒŸ Imagine yourself at a star-studded Hollywood party surrounded by famous faces. Your mission is to find a specific celebrity among the crowd. Every round, a new target celebrity is chosen. Identify them correctly to win the round! **How to Play**: 1. **๐Ÿ–ผ๏ธ Upload an Image**: Start by uploading an image featuring a celebrity. 2. **๐Ÿ” Check Your Guess**: The app will let you know if the celebrity in your image matches the target. 3. **๐Ÿ† Win or Try Again**: Guess correctly to see a celebratory meme! If not, upload another image and try again. 4. **๐Ÿ”„ Reset the Game**: Click 'Reset' to get a new target celebrity and start fresh. This mode is perfect for testing your celebrity spotting skills and having a blast! *Note:* ๐Ÿ”„ *If you encounter an error, please refresh the page.* """ upload_mode_intro = """ ## ๐Ÿ“ค Upload Mode: Who's in the Picture? **Story**: ๐Ÿ“ธ You've stumbled upon a photo filled with celebrities, but can't quite remember all their names. Don't stressโ€”our Upload Mode has got you covered! Simply upload the image, and we'll identify the stars for you in seconds. **How to Use**: 1. **๐Ÿ–ผ๏ธ Upload an Image**: Choose a photo that contains one or more celebrities. 2. **๐Ÿง  View Detected Celebrities**: The app will scan the image and list all detected celebrities. 3. **โ˜‘๏ธ Select a Celebrity**: Use the radio button to select the name of a celebrity from the list. 4. **โ„น๏ธ See Details**: Once selected, the app displays details and a fun meme related to the celebrity. This mode is perfect for quickly recognizing multiple celebrities and learning more about them! *Note:* ๐Ÿ”„ *If you encounter an error, please refresh the page.* """ # Combining the detailed intro, story, and interaction instructions into a single interface with gr.Blocks() as main_interface: gr.Markdown('# Welcome to the Celebrity Recognition Application ๐Ÿ˜ถโ€๐ŸŒซ๏ธ!') with gr.Tabs(): with gr.TabItem("Intro"): gr.Markdown(intro) with gr.TabItem("Game Mode"): gr.Markdown(game_mode_intro) game_block.render() with gr.TabItem("Upload Mode"): gr.Markdown(upload_mode_intro) upload_interface.render() if __name__ == "__main__": main_interface.launch(share=True)