farid678 commited on
Commit
a5a461a
1 Parent(s): 182ad85

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
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, model=model):
 
 
 
 
 
 
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))