From b9b7d1fcd1de2dfebfc09444cde498a51cd4abb6 Mon Sep 17 00:00:00 2001
From: ageorge <anjith.george@idiap.ch>
Date: Mon, 12 Jul 2021 11:41:26 +0200
Subject: [PATCH] Fixes normalization

---
 bob/bio/face/embeddings/pytorch.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/bob/bio/face/embeddings/pytorch.py b/bob/bio/face/embeddings/pytorch.py
index 5d4c02ed..4c03a74a 100644
--- a/bob/bio/face/embeddings/pytorch.py
+++ b/bob/bio/face/embeddings/pytorch.py
@@ -160,7 +160,7 @@ class IResnet34(PyTorchModel):
     ArcFace model (RESNET 34) from Insightface ported to pytorch
     """
 
-    def __init__(self, memory_demanding=False):
+    def __init__(self, preprocessor=lambda x: (x - 127.5) / 128.0, memory_demanding=False):
 
         urls = [
             "https://www.idiap.ch/software/bob/data/bob/bob.bio.face/master/pytorch/iresnet-91a5de61.tar.gz",
@@ -188,7 +188,7 @@ class IResnet50(PyTorchModel):
     ArcFace model (RESNET 50) from Insightface ported to pytorch
     """
 
-    def __init__(self, memory_demanding=False):
+    def __init__(self, preprocessor=lambda x: (x - 127.5) / 128.0, memory_demanding=False):
 
         filename = _get_iresnet_file()
 
@@ -206,12 +206,12 @@ class IResnet50(PyTorchModel):
         self.model = model
 
 
-class IResnet100(PyTorchModel):
+class IResnet100(PyTorchModel): 
     """
     ArcFace model (RESNET 100) from Insightface ported to pytorch
     """
 
-    def __init__(self, memory_demanding=False):
+    def __init__(self, preprocessor=lambda x: (x - 127.5) / 128.0, memory_demanding=False):
 
         filename = _get_iresnet_file()
 
-- 
GitLab