Harveenchadha commited on
Commit
63317d7
Β·
1 Parent(s): 8b2e89d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -5
app.py CHANGED
@@ -11,20 +11,17 @@ model = from_pretrained_keras("Harveenchadha/low-light-image-enhancement", compi
11
 
12
 
13
  def infer(original_image):
14
-
15
  image = keras.preprocessing.image.img_to_array(original_image)
16
  image = image.astype("float32") / 255.0
17
  image = np.expand_dims(image, axis=0)
18
-
19
  output = model.predict(image)
20
- # print(len(output))
21
- # print([len(a) for a in output])
22
  output_image = output[0] * 255.0
23
  output_image = output_image.clip(0, 255)
24
  output_image = output_image.reshape(
25
- (np.shape(image)[0], np.shape(image)[1], 3)
26
  )
27
  output_image = np.uint32(output_image)
 
28
 
29
  # output_image = tf.cast((output[0, :, :, :] * 255), dtype=np.uint8)
30
 
 
11
 
12
 
13
  def infer(original_image):
 
14
  image = keras.preprocessing.image.img_to_array(original_image)
15
  image = image.astype("float32") / 255.0
16
  image = np.expand_dims(image, axis=0)
 
17
  output = model.predict(image)
 
 
18
  output_image = output[0] * 255.0
19
  output_image = output_image.clip(0, 255)
20
  output_image = output_image.reshape(
21
+ (np.shape(output_image)[0], np.shape(output_image)[1], 3)
22
  )
23
  output_image = np.uint32(output_image)
24
+ return output_image
25
 
26
  # output_image = tf.cast((output[0, :, :, :] * 255), dtype=np.uint8)
27