Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,7 @@ from scipy.spatial.distance import cosine
|
|
6 |
from mtcnn.mtcnn import MTCNN
|
7 |
import gradio as gr
|
8 |
from tensorflow.keras.models import Model
|
|
|
9 |
from tensorflow.saved_model import load
|
10 |
import pathlib
|
11 |
from fastai.vision.all import *
|
@@ -14,7 +15,7 @@ from fastai.imports import *
|
|
14 |
plt = platform.system()
|
15 |
if plt == 'Linux':
|
16 |
pathlib.WindowsPath = pathlib.PosixPath
|
17 |
-
model =
|
18 |
|
19 |
def img_to_encoding(image_path, model):
|
20 |
img = Image.open(image_path)
|
|
|
6 |
from mtcnn.mtcnn import MTCNN
|
7 |
import gradio as gr
|
8 |
from tensorflow.keras.models import Model
|
9 |
+
from tensorflow.keras.models import load_model
|
10 |
from tensorflow.saved_model import load
|
11 |
import pathlib
|
12 |
from fastai.vision.all import *
|
|
|
15 |
plt = platform.system()
|
16 |
if plt == 'Linux':
|
17 |
pathlib.WindowsPath = pathlib.PosixPath
|
18 |
+
model = load_model(filename="senet50")
|
19 |
|
20 |
def img_to_encoding(image_path, model):
|
21 |
img = Image.open(image_path)
|