Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.bio.face
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.bio.face
Commits
5ba53ae9
Commit
5ba53ae9
authored
4 years ago
by
Tiago de Freitas Pereira
Browse files
Options
Downloads
Patches
Plain Diff
Remove __setitem__ and [black]
parent
ae1afa0d
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!79
Arcface from InsightFace
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bob/bio/face/embeddings/mxnet_models.py
+1
-3
1 addition, 3 deletions
bob/bio/face/embeddings/mxnet_models.py
bob/bio/face/embeddings/tf2_inception_resnet.py
+7
-9
7 additions, 9 deletions
bob/bio/face/embeddings/tf2_inception_resnet.py
with
8 additions
and
12 deletions
bob/bio/face/embeddings/mxnet_models.py
+
1
−
3
View file @
5ba53ae9
...
@@ -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
()
...
...
This diff is collapsed.
Click to expand it.
bob/bio/face/embeddings/tf2_inception_resnet.py
+
7
−
9
View file @
5ba53ae9
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment