Spaces:
Running
Running
Deniel Dimitrov
commited on
Commit
·
d883fba
1
Parent(s):
2afd058
Update app.py
Browse files
app.py
CHANGED
@@ -2,10 +2,10 @@
|
|
2 |
from PIL import Image, ImageTk
|
3 |
import gradio as gr
|
4 |
|
5 |
-
def convert_to_ascii(image,
|
6 |
width, height = image.size
|
7 |
aspect_ratio = height / width
|
8 |
-
new_width =
|
9 |
new_height = int(aspect_ratio * text_size * 0.5)
|
10 |
|
11 |
resized_image = image.resize((new_width, new_height))
|
@@ -31,7 +31,7 @@ def convert_to_ascii(image,integer):
|
|
31 |
# Create an Interface with a title
|
32 |
iface = gr.Interface(
|
33 |
fn=convert_to_ascii, # Function to run
|
34 |
-
inputs=["image","
|
35 |
outputs="text", # Output component (in this case, text)
|
36 |
title="image-to-ascii (by peasoup)" # Title for the interface
|
37 |
)
|
|
|
2 |
from PIL import Image, ImageTk
|
3 |
import gradio as gr
|
4 |
|
5 |
+
def convert_to_ascii(image,text_size):
|
6 |
width, height = image.size
|
7 |
aspect_ratio = height / width
|
8 |
+
new_width = int(text_size)
|
9 |
new_height = int(aspect_ratio * text_size * 0.5)
|
10 |
|
11 |
resized_image = image.resize((new_width, new_height))
|
|
|
31 |
# Create an Interface with a title
|
32 |
iface = gr.Interface(
|
33 |
fn=convert_to_ascii, # Function to run
|
34 |
+
inputs=["image","number"], # Input component (in this case, an image)
|
35 |
outputs="text", # Output component (in this case, text)
|
36 |
title="image-to-ascii (by peasoup)" # Title for the interface
|
37 |
)
|