Spaces:
Paused
Paused
Update main.py
Browse files
main.py
CHANGED
|
@@ -1,10 +1,11 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
from PIL import Image
|
| 3 |
|
| 4 |
def generate_ascii_art(image):
|
| 5 |
try:
|
| 6 |
-
#
|
| 7 |
-
img = Image.
|
| 8 |
|
| 9 |
# Resize the image to a smaller size for faster processing
|
| 10 |
img = img.resize((80, 60))
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import numpy as np
|
| 3 |
from PIL import Image
|
| 4 |
|
| 5 |
def generate_ascii_art(image):
|
| 6 |
try:
|
| 7 |
+
# Convert the numpy array to a PIL Image
|
| 8 |
+
img = Image.fromarray(np.uint8(image))
|
| 9 |
|
| 10 |
# Resize the image to a smaller size for faster processing
|
| 11 |
img = img.resize((80, 60))
|