okaris commited on
Commit
abe10b5
1 Parent(s): 8fd7005

Gradio send images as np array

Browse files
Files changed (1) hide show
  1. utils.py +3 -0
utils.py CHANGED
@@ -68,6 +68,9 @@ def load_and_resize_image(image_path, max_width, max_height, maintain_aspect_rat
68
  """
69
 
70
  # Open the image
 
 
 
71
  image = load_image(image_path)
72
 
73
  # Get the current width and height of the image
 
68
  """
69
 
70
  # Open the image
71
+ if isinstance(image_path, np.ndarray):
72
+ image = Image.fromarray(image_path)
73
+
74
  image = load_image(image_path)
75
 
76
  # Get the current width and height of the image