Update app.py
Browse files
app.py
CHANGED
@@ -4,15 +4,16 @@ import numpy as np
|
|
4 |
|
5 |
|
6 |
|
7 |
-
json_file = open('xception.json', 'r')
|
8 |
-
loaded_file_json = json_file.read()
|
9 |
-
json_file.close()
|
10 |
|
11 |
-
model = model_from_json(loaded_file_json)
|
12 |
-
model.load_weights('xception_modelv2.h5')
|
13 |
|
14 |
|
15 |
-
def predict_age_gender(image
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
img_pixels = np.expand_dims(image, axis=0)
|
17 |
img_pixels = image.astype('float')
|
18 |
img_pixels = img_pixels.reshape((1, 128, 128, 3))
|
|
|
4 |
|
5 |
|
6 |
|
|
|
|
|
|
|
7 |
|
|
|
|
|
8 |
|
9 |
|
10 |
+
def predict_age_gender(image):
|
11 |
+
json_file = open('xception.json', 'r')
|
12 |
+
loaded_file_json = json_file.read()
|
13 |
+
json_file.close()
|
14 |
+
|
15 |
+
model = model_from_json(loaded_file_json)
|
16 |
+
model.load_weights('xception_modelv2.h5')
|
17 |
img_pixels = np.expand_dims(image, axis=0)
|
18 |
img_pixels = image.astype('float')
|
19 |
img_pixels = img_pixels.reshape((1, 128, 128, 3))
|