ImanAmran commited on
Commit
a31f38f
·
1 Parent(s): dfd4228

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -25
app.py CHANGED
@@ -1,25 +1,7 @@
1
- #!/usr/bin/env python3
2
- # -*- coding: utf-8 -*-
3
-
4
- """
5
- Created on Tue Nov 28 08:18:59 2023
6
-
7
- @author: iman
8
- """
9
-
10
- import tensorflow as tf
11
- from tensorflow.keras import Model
12
- from tensorflow.keras.models import load_model
13
-
14
- # Function to preprocess the image
15
- def preprocess_image(filename, target_shape=(160, 160)):
16
- image_string = tf.io.read_file(filename)
17
- image = tf.image.decode_jpeg(image_string, channels=3)
18
- image = tf.image.convert_image_dtype(image, tf.float32)
19
- image = tf.image.resize(image, target_shape)
20
- return image
21
-
22
- print("Hello")
23
-
24
- # Load the base FaceNet model
25
- facenet_model = load_model('facenet_keras.h5', compile=False)
 
1
+ # example of loading the keras facenet model
2
+ from keras.models import load_model
3
+ # load the model
4
+ model = load_model('facenet_keras.h5')
5
+ # summarize input and output shape
6
+ print(model.inputs)
7
+ print(model.outputs)