Skip to content
Snippets Groups Projects
Commit 5ba53ae9 authored by Tiago de Freitas Pereira's avatar Tiago de Freitas Pereira
Browse files

Remove __setitem__ and [black]

parent ae1afa0d
Branches
Tags
1 merge request!79Arcface from InsightFace
...@@ -10,6 +10,7 @@ import pkg_resources ...@@ -10,6 +10,7 @@ import pkg_resources
import os import os
from bob.extension import rc from bob.extension import rc
class ArcFaceInsightFace(TransformerMixin, BaseEstimator): class ArcFaceInsightFace(TransformerMixin, BaseEstimator):
""" """
ArcFace from Insight Face. ArcFace from Insight Face.
...@@ -79,9 +80,6 @@ class ArcFaceInsightFace(TransformerMixin, BaseEstimator): ...@@ -79,9 +80,6 @@ class ArcFaceInsightFace(TransformerMixin, BaseEstimator):
self.model.forward(db, is_train=False) self.model.forward(db, is_train=False)
return self.model.get_outputs()[0].asnumpy() return self.model.get_outputs()[0].asnumpy()
def __setstate__(self, d):
self.__dict__ = d
def __getstate__(self): def __getstate__(self):
# Handling unpicklable objects # Handling unpicklable objects
d = self.__dict__.copy() d = self.__dict__.copy()
......
...@@ -68,9 +68,6 @@ class InceptionResnet(TransformerMixin, BaseEstimator): ...@@ -68,9 +68,6 @@ class InceptionResnet(TransformerMixin, BaseEstimator):
return self.inference(X).numpy() return self.inference(X).numpy()
def __setstate__(self, d):
self.__dict__ = d
def __getstate__(self): def __getstate__(self):
# Handling unpicklable objects # Handling unpicklable objects
d = self.__dict__.copy() d = self.__dict__.copy()
...@@ -146,7 +143,6 @@ class InceptionResnetv2_Casia_CenterLoss_2018(InceptionResnet): ...@@ -146,7 +143,6 @@ class InceptionResnetv2_Casia_CenterLoss_2018(InceptionResnet):
) )
class InceptionResnetv1_Casia_CenterLoss_2018(InceptionResnet): class InceptionResnetv1_Casia_CenterLoss_2018(InceptionResnet):
""" """
InceptionResnet v1 model trained in 2018 using the CasiaWebFace dataset in the context of the work: InceptionResnet v1 model trained in 2018 using the CasiaWebFace dataset in the context of the work:
...@@ -172,12 +168,13 @@ class InceptionResnetv1_Casia_CenterLoss_2018(InceptionResnet): ...@@ -172,12 +168,13 @@ class InceptionResnetv1_Casia_CenterLoss_2018(InceptionResnet):
download_model( download_model(
checkpoint_path, urls, "inceptionresnetv1_casia_centerloss_2018.tar.gz" checkpoint_path, urls, "inceptionresnetv1_casia_centerloss_2018.tar.gz"
) )
super(InceptionResnetv1_Casia_CenterLoss_2018, self).__init__( super(InceptionResnetv1_Casia_CenterLoss_2018, self).__init__(
checkpoint_path, preprocessor=tf.image.per_image_standardization, checkpoint_path, preprocessor=tf.image.per_image_standardization,
) )
class InceptionResnetv1_MsCeleb_CenterLoss_2018(InceptionResnet): class InceptionResnetv1_MsCeleb_CenterLoss_2018(InceptionResnet):
""" """
InceptionResnet v1 model trained in 2018 using the MsCeleb dataset in the context of the work: InceptionResnet v1 model trained in 2018 using the MsCeleb dataset in the context of the work:
...@@ -193,7 +190,8 @@ class InceptionResnetv1_MsCeleb_CenterLoss_2018(InceptionResnet): ...@@ -193,7 +190,8 @@ class InceptionResnetv1_MsCeleb_CenterLoss_2018(InceptionResnet):
checkpoint_path = ( checkpoint_path = (
internal_path internal_path
if rc["bob.bio.face.models.InceptionResnetv1_MsCeleb_CenterLoss_2018"] is None if rc["bob.bio.face.models.InceptionResnetv1_MsCeleb_CenterLoss_2018"]
is None
else rc["bob.bio.face.models.InceptionResnetv1_MsCeleb_CenterLoss_2018"] else rc["bob.bio.face.models.InceptionResnetv1_MsCeleb_CenterLoss_2018"]
) )
...@@ -203,7 +201,7 @@ class InceptionResnetv1_MsCeleb_CenterLoss_2018(InceptionResnet): ...@@ -203,7 +201,7 @@ class InceptionResnetv1_MsCeleb_CenterLoss_2018(InceptionResnet):
download_model( download_model(
checkpoint_path, urls, "inceptionresnetv1_msceleb_centerloss_2018.tar.gz" checkpoint_path, urls, "inceptionresnetv1_msceleb_centerloss_2018.tar.gz"
) )
super(InceptionResnetv1_MsCeleb_CenterLoss_2018, self).__init__( super(InceptionResnetv1_MsCeleb_CenterLoss_2018, self).__init__(
checkpoint_path, preprocessor=tf.image.per_image_standardization, checkpoint_path, preprocessor=tf.image.per_image_standardization,
...@@ -249,8 +247,8 @@ class FaceNetSanderberg_20170512_110547(InceptionResnet): ...@@ -249,8 +247,8 @@ class FaceNetSanderberg_20170512_110547(InceptionResnet):
download_model( download_model(
checkpoint_path, urls, "facenet_sanderberg_20170512_110547.tar.gz" checkpoint_path, urls, "facenet_sanderberg_20170512_110547.tar.gz"
) )
super(FaceNetSanderberg_20170512_110547, self).__init__( super(FaceNetSanderberg_20170512_110547, self).__init__(
checkpoint_path, tf.image.per_image_standardization, checkpoint_path, tf.image.per_image_standardization,
) )
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment