import streamlit as st import google.generativeai as genai import os # Configure the API key api_key = 'AIzaSyC13hxiLDZQagfXybLKCklbTlBDsO4vHwQ' genai.configure(api_key=api_key) # Function to upload and process the image def process_image(image_path, user_question=None): try: # Upload the image to Google Generative AI sample_file = genai.upload_file(path=image_path, display_name="Sample drawing") # Use the Generative AI model to analyze the image model = genai.GenerativeModel(model_name="models/gemini-2.0-flash-exp") # Prepare the prompt prompt = user_question if user_question else "Explain the scene in the image in detail." response = model.generate_content([prompt, sample_file]) # Display the response st.write("**VisioX Analysis:**") st.write(response.text) # Delete the uploaded file genai.delete_file(sample_file.name) except Exception as e: st.error(f"An error occurred: {e}") # Custom CSS for cyberpunk styling def set_cyberpunk_style(): st.markdown( """ """, unsafe_allow_html=True, ) # Streamlit app def main(): # Set cyberpunk style set_cyberpunk_style() # App title and description st.title("VisioX : SXR") st.markdown( """