farid678 commited on
Commit
3d83403
1 Parent(s): e169b99

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -12
app.py CHANGED
@@ -1,19 +1,9 @@
1
  import gradio as gr
2
-
3
-
4
 
5
 
6
  def predict_age_gender(image):
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
- # img_pixels = image.img_to_array(image)
16
- # img = tf.reshape(image, shape=(-1, 128, 128, 3))
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))
 
1
  import gradio as gr
2
+ from .model import model
3
+ import numpy as np
4
 
5
 
6
  def predict_age_gender(image):
 
 
 
 
 
 
 
 
 
 
7
  img_pixels = np.expand_dims(image, axis=0)
8
  img_pixels = image.astype('float')
9
  img_pixels = img_pixels.reshape((1, 128, 128, 3))