Skip to content

Commit

Permalink
Update classifier.py
Browse files Browse the repository at this point in the history
  • Loading branch information
TroddenSpade committed Jul 9, 2021
1 parent e5c8e08 commit b1cc9ed
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import numpy as np
import cv2

model = tf.keras.models.load_model('models/spc1.h5')
model = tf.keras.models.load_model('models/spc3.h5')

def classify(X):
res = model.predict(X)
Expand All @@ -12,4 +12,7 @@ def classify(X):
def preprocess(img):
img = img.astype(np.float32) / 255
resized_image = cv2.resize(img, (10, 28))
# means = resized_image.mean(axis=(0,1), dtype='float64')
# std = resized_image.std(axis=(0,1), dtype='float64')
# normalized_img = (resized_image - means) / std
return resized_image

0 comments on commit b1cc9ed

Please sign in to comment.