Akshay-Vs commited on
Commit
eb522d1
1 Parent(s): 8abc2d3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -3,6 +3,7 @@ from PIL import Image
3
  import tensorflow as tf
4
  from tensorflow.keras.preprocessing.image import img_to_array
5
  import numpy as np
 
6
 
7
  path_to_model = "nova.h5"
8
 
@@ -14,7 +15,7 @@ IMG_WIDTH = 180
14
 
15
  # Preprocessing
16
  def preprocess_image(image):
17
- img = image.resize((IMG_HEIGHT, IMG_WIDTH))
18
  img_array = img_to_array(img)
19
  img_array = img_array / 255.0
20
  img_array = np.reshape(img_array, (1, IMG_HEIGHT, IMG_WIDTH, 3))
 
3
  import tensorflow as tf
4
  from tensorflow.keras.preprocessing.image import img_to_array
5
  import numpy as np
6
+ import cv2
7
 
8
  path_to_model = "nova.h5"
9
 
 
15
 
16
  # Preprocessing
17
  def preprocess_image(image):
18
+ img = cv2.resize(image, (IMG_HEIGHT, IMG_WIDTH))
19
  img_array = img_to_array(img)
20
  img_array = img_array / 255.0
21
  img_array = np.reshape(img_array, (1, IMG_HEIGHT, IMG_WIDTH, 3))