Update app.py
Browse files
app.py
CHANGED
@@ -1,16 +1,24 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
def create_interface():
|
4 |
title = "Empowering Everything with AI"
|
5 |
-
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."
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
8 |
|
9 |
with gr.Blocks() as demo:
|
10 |
gr.Markdown(f"# {title}")
|
11 |
gr.Markdown(subtitle)
|
12 |
-
gr.
|
13 |
-
gr.Image(image_path)
|
14 |
|
15 |
return demo
|
16 |
|
|
|
1 |
import gradio as gr
|
2 |
+
from PIL import Image
|
3 |
+
|
4 |
+
def resize_image(input_path, output_path, size):
|
5 |
+
with Image.open(input_path) as img:
|
6 |
+
img = img.resize(size, Image.ANTIALIAS)
|
7 |
+
img.save(output_path)
|
8 |
|
9 |
def create_interface():
|
10 |
title = "Empowering Everything with AI"
|
11 |
+
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."
|
12 |
+
input_image_path = "image.png"
|
13 |
+
output_image_path = "resized_image.png"
|
14 |
+
|
15 |
+
# Resize the image
|
16 |
+
resize_image(input_image_path, output_image_path, (300, 200)) # Adjust size as needed
|
17 |
|
18 |
with gr.Blocks() as demo:
|
19 |
gr.Markdown(f"# {title}")
|
20 |
gr.Markdown(subtitle)
|
21 |
+
gr.Image(output_image_path)
|
|
|
22 |
|
23 |
return demo
|
24 |
|