inception_resnetv2_casiawebface.py 838 Bytes
Newer Older
1
2
3
from bob.bio.face.embeddings.tf2_inception_resnet import (
    InceptionResnetv2_Casia_CenterLoss_2018,
)
4
from bob.bio.face.config.baseline.helpers import embedding_transformer_160x160
5
6
7
8
from bob.bio.base.pipelines.vanilla_biometrics import (
    Distance,
    VanillaBiometricsPipeline,
)
9
10
11
12
13
14
15
16
17
18


if "database" in locals():
    annotation_type = database.annotation_type
    fixed_positions = database.fixed_positions
else:
    annotation_type = None
    fixed_positions = None


19
20
def load(annotation_type, fixed_positions=None):
    transformer = embedding_transformer_160x160(
21
        InceptionResnetv2_Casia_CenterLoss_2018(), annotation_type, fixed_positions
22
    )
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
23

24
    algorithm = Distance()
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
25

26
27
28
29
    return VanillaBiometricsPipeline(transformer, algorithm)


pipeline = load(annotation_type, fixed_positions)
30
transformer = pipeline.transformer