ruslanmv commited on
Commit
41e193d
·
verified ·
1 Parent(s): 1a1b115

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -2
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
- # Open the image using Pillow
7
- img = Image.open(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))