import os, base64 import gradio as gr PROJECT_NAME = "ViVQA-X: LSTM-Generative Model" def image_to_base64(image_path: str): # Construct the absolute path to the image current_dir = os.path.dirname(os.path.abspath(__file__)) full_image_path = os.path.join(current_dir, image_path) with open(full_image_path, "rb") as f: return base64.b64encode(f.read()).decode("utf-8") def create_header(): with gr.Row(): with gr.Column(scale=2): logo_base64 = image_to_base64("static/aivn_logo.png") gr.HTML( f"""Logo""" ) with gr.Column(scale=2): gr.HTML(f"""

{PROJECT_NAME}

""") def create_footer(): logo_base64_vlai = image_to_base64("static/vlai_logo.png") footer_html = """ """ + f""" """ return gr.HTML(footer_html) custom_css = """ .gradio-container { min-height:64vh; background: linear-gradient(135deg, #F5EFE6 0%, #E8DFCA 50%, #AEBDCA 100%); background-size: 400% 400%; animation: gradientBG 10s ease infinite; } @keyframes gradientBG { 0% {background-position: 0% 50%;} 50% {background-position: 100% 50%;} 100% {background-position: 0% 50%;} } .content-wrap {padding-bottom:8px;} .full-width-btn { width: 100% !important; } """