import gradio as gr from PIL import Image def resize_image(input_path, output_path, size): with Image.open(input_path) as img: img = img.resize(size, Image.ANTIALIAS) img.save(output_path) def create_interface(): title = "Empowering Everything with AI" subtitle = "We believe in empowering everything through the transformative power of AI. Just like a hydrangea, where many people come together to create a new society. \nJoin us in building a future where AI connects and enhances every aspect of life." input_image_path = "image.jpeg" output_image_path = "resized_image.jpeg" # Resize the image resize_image(input_image_path, output_image_path, (150, 100)) # Adjust size as needed with gr.Blocks() as demo: gr.Markdown(f"# {title}") gr.Markdown(subtitle) gr.Image(output_image_path) return demo if __name__ == "__main__": demo = create_interface() demo.launch()