-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathget_model.py
More file actions
30 lines (28 loc) · 808 Bytes
/
Copy pathget_model.py
File metadata and controls
30 lines (28 loc) · 808 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import os
import sys
sys.path.append(os.path.join('networks'))
from CosFace import CosFace
from SphereFace import SphereFace
from ArcFace import ArcFace
def getmodel(face_model, **kwargs):
"""
select the face model according to its name
:param face_model: string
:param FLAGS: a tf FLAGS (should be replace later)
:param is_use_crop: boolean, whether the network accepted cropped images or uncropped images
:loss_type: string, the loss to generate adversarial examples
return:
a model class
"""
img_shape = (112, 112)
if face_model == 'CosFace':
model = CosFace(**kwargs)
img_shape = (112, 96)
elif face_model == 'SphereFace':
model = SphereFace(**kwargs)
img_shape = (112, 96)
elif face_model == 'ArcFace':
model = ArcFace()
else:
raise Exception
return model, img_shape