vumichien commited on
Commit
29c1806
1 Parent(s): 5e26374

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -2,13 +2,14 @@ import numpy as np
2
  import gradio as gr
3
  from huggingface_hub import from_pretrained_keras
4
  import keras
 
5
 
6
  model = from_pretrained_keras("keras-io/lowlight-enhance-mirnet", compile=False)
7
  examples = ['examples/1.png', 'examples/55.png', 'examples/665.png', 'examples/778.png']
8
 
9
 
10
  def infer(original_image):
11
- image = keras.preprocessing.image.img_to_array(original_image)
12
  image = image.astype("float32") / 255.0
13
  image = np.expand_dims(image, axis=0)
14
  output = model.predict(image)
 
2
  import gradio as gr
3
  from huggingface_hub import from_pretrained_keras
4
  import keras
5
+ import tensorflow as tf
6
 
7
  model = from_pretrained_keras("keras-io/lowlight-enhance-mirnet", compile=False)
8
  examples = ['examples/1.png', 'examples/55.png', 'examples/665.png', 'examples/778.png']
9
 
10
 
11
  def infer(original_image):
12
+ image = tf.keras.preprocessing.image.img_to_array(original_image)
13
  image = image.astype("float32") / 255.0
14
  image = np.expand_dims(image, axis=0)
15
  output = model.predict(image)