Update app.py
Browse files
app.py
CHANGED
@@ -54,7 +54,9 @@ def load_model_detection():
|
|
54 |
|
55 |
def preprocess_image(image):
|
56 |
""" Preprocess the image to the required size and normalization. """
|
57 |
-
|
|
|
|
|
58 |
image = (image - 127.5) / 127.5 # Normalize to [-1, +1]
|
59 |
image = np.expand_dims(image, axis=0).astype(np.float32)
|
60 |
return image
|
|
|
54 |
|
55 |
def preprocess_image(image):
|
56 |
""" Preprocess the image to the required size and normalization. """
|
57 |
+
W = 320
|
58 |
+
H = 320
|
59 |
+
image = cv2.resize(image, (W, H))
|
60 |
image = (image - 127.5) / 127.5 # Normalize to [-1, +1]
|
61 |
image = np.expand_dims(image, axis=0).astype(np.float32)
|
62 |
return image
|