Harveenchadha commited on
Commit
bcf70ba
β€’
1 Parent(s): 5464b05

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -16
app.py CHANGED
@@ -35,22 +35,8 @@ def infer(original_image):
35
  image = np.expand_dims(image, axis=0)
36
  output = model.predict(image)
37
  output = get_enhanced_image(image, output)
38
- output_image = output[0] * 255.0
39
- output_image = output_image.clip(0, 255)
40
- print(output_image)
41
- print(len(output_image))
42
- print([len(a) for a in output_image])
43
- output_image = output_image.reshape(
44
- (np.shape(output_image)[0], np.shape(output_image)[1], 3)
45
- )
46
- output_image = np.uint32(output_image)
47
-
48
- return output_image
49
-
50
- # output_image = tf.cast((output[0, :, :, :] * 255), dtype=np.uint8)
51
-
52
-
53
- # #output_image = Image.fromarray(output_image.numpy())
54
  # output_image = output_image.numpy()
55
  # print(output_image.shape())
56
  return output_image
 
35
  image = np.expand_dims(image, axis=0)
36
  output = model.predict(image)
37
  output = get_enhanced_image(image, output)
38
+ output_image = tf.cast((output[0, :, :, :] * 255), dtype=np.uint8)
39
+ output_image = Image.fromarray(output_image.numpy())
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  # output_image = output_image.numpy()
41
  # print(output_image.shape())
42
  return output_image