1
- from typing import List
2
1
import os
3
2
import gdown
4
- import numpy as np
5
3
from deepface .commons import package_utils , folder_utils
6
4
from deepface .commons .logger import Logger
7
5
from deepface .models .FacialRecognition import FacialRecognition
@@ -56,18 +54,6 @@ def __init__(self):
56
54
self .input_shape = (160 , 160 )
57
55
self .output_shape = 128
58
56
59
- def find_embeddings (self , img : np .ndarray ) -> List [float ]:
60
- """
61
- find embeddings with FaceNet-128d model
62
- Args:
63
- img (np.ndarray): pre-loaded image in BGR
64
- Returns
65
- embeddings (list): multi-dimensional vector
66
- """
67
- # model.predict causes memory issue when it is called in a for loop
68
- # embedding = model.predict(img, verbose=0)[0].tolist()
69
- return self .model (img , training = False ).numpy ()[0 ].tolist ()
70
-
71
57
72
58
class FaceNet512dClient (FacialRecognition ):
73
59
"""
@@ -80,18 +66,6 @@ def __init__(self):
80
66
self .input_shape = (160 , 160 )
81
67
self .output_shape = 512
82
68
83
- def find_embeddings (self , img : np .ndarray ) -> List [float ]:
84
- """
85
- find embeddings with FaceNet-512d model
86
- Args:
87
- img (np.ndarray): pre-loaded image in BGR
88
- Returns
89
- embeddings (list): multi-dimensional vector
90
- """
91
- # model.predict causes memory issue when it is called in a for loop
92
- # embedding = model.predict(img, verbose=0)[0].tolist()
93
- return self .model (img , training = False ).numpy ()[0 ].tolist ()
94
-
95
69
96
70
def scaling (x , scale ):
97
71
return x * scale
0 commit comments