"""Extracts features using deep face recognition models under OpenCV Interface
Users can download the pretrained face recognition models with OpenCV Interface. The path to downloaded models should be specified before running the extractor (usually before running the pipeline file that includes the extractor). That is, set config of the model frame to :py:class:`bob.extractor_model.opencv`, and set config of the parameters to :py:class:`bob.extractor_weights.opencv`.
...
...
@@ -39,8 +39,6 @@ class opencv_model(TransformerMixin, BaseEstimator):
.. note::
This structure only can be used for CAFFE pretrained model.
"""
def__init__(self,**kwargs):
...
...
@@ -82,10 +80,10 @@ class opencv_model(TransformerMixin, BaseEstimator):
"""
ifself.modelisNone:
self._load_model()
img=np.array(X)
img=img/255
self.model.setInput(img)
...
...
@@ -99,5 +97,4 @@ class opencv_model(TransformerMixin, BaseEstimator):
"""Extracts features using deep face recognition models under PyTorch Interface, especially for the models and weights that need to load by hand.
Users can download the pretrained face recognition models with PyTorch Interface. The path to downloaded models should be specified before running the extractor (usually before running the pipeline file that includes the extractor). That is, set config of the model frame to :py:class:`bob.extractor_model.pytorch`, and set config of the parameters to :py:class:`bob.extractor_weights.pytorch`.
...
...
@@ -28,8 +28,6 @@ class pytorch_loaded_model(TransformerMixin, BaseEstimator):
$ bob config set bob.extractor_weights.pytorch /PATH/TO/WEIGHTS/
The extracted features can be combined with different the algorithms.
"""
def__init__(self,**kwargs):
...
...
@@ -76,11 +74,11 @@ class pytorch_loaded_model(TransformerMixin, BaseEstimator):
feature : 2D or 3D :py:class:`numpy.ndarray` (floats)
The list of features extracted from the image.
"""
ifself.modelisNone:
self._load_model()
X=torch.Tensor(X)
X=X/255
returnself.model(X).detach().numpy()
...
...
@@ -92,11 +90,10 @@ class pytorch_loaded_model(TransformerMixin, BaseEstimator):
"""Extracts features using deep face recognition with registered model frames in the PyTorch Library.
Users can import the pretrained face recognition models from PyTorch library. The model should be called in the pipeline. Example: `facenet_pytorch <https://github.com/timesler/facenet-pytorch>`_
...
...
@@ -105,7 +102,6 @@ class pytorch_library_model(TransformerMixin, BaseEstimator):
**Parameters:**
model: pytorch model calling from library.
use_gpu: True or False.
"""
def__init__(self,model=None,**kwargs):
...
...
@@ -125,6 +121,11 @@ class pytorch_library_model(TransformerMixin, BaseEstimator):
"""Extracts features using deep face recognition models under TensorFlow Interface.
Users can download the pretrained face recognition models with TensorFlow Interface. The path to downloaded models should be specified before running the extractor (usually before running the pipeline file that includes the extractor). That is, set config of the model to :py:class:`bob.extractor_model.tf`.
...
...
@@ -28,8 +28,6 @@ class tf_model(TransformerMixin, BaseEstimator):
$ bob config set bob.extractor_model.tf /PATH/TO/MODEL/
The extracted features can be combined with different the algorithms.
"""
def__init__(self,**kwargs):
...
...
@@ -76,6 +74,8 @@ class tf_model(TransformerMixin, BaseEstimator):
* ``mxnet_pipe``: Arcface Resnet Model using MxNet Interfaces from `Insightface <https://github.com/deepinsight/insightface>`_
* ``mxnet-pipe``: Arcface Resnet Model using MxNet Interfaces from `Insightface <https://github.com/deepinsight/insightface>`_
* ``pytorch_pipe_v1``: Pytorch network that extracs 1000-dimensional featrues, trained by Manual Gunther, as described in [LGB18]_
* ``mxnet-tinyface``: Applying `tinyface annoator <https://github.com/chinakook/hr101_mxnet>`_ for the Arcface Resnet Model using MxNet Interfaces from `Insightface <https://github.com/deepinsight/insightface>`_
* ``pytorch_pipe_v2``: Inception Resnet face recognition model from `facenet_pytorch <https://github.com/timesler/facenet-pytorch>`_
* ``pytorch-pipe-v1``: Pytorch network that extracts 1000-dimensional features, trained by Manual Gunther, as described in [LGB18]_
* ``tf_pipe``: Inception Resnet v2 model trained using the MSCeleb dataset in the context of the work published by [TFP18]_
* ``pytorch-pipe-v2``: Inception Resnet face recognition model from `facenet_pytorch <https://github.com/timesler/facenet-pytorch>`_
* ``opencv_pipe``: VGG Face descriptor pretrained models, i.e. `Caffe model <https://www.robots.ox.ac.uk/~vgg/software/vgg_face/>`_
* ``tf-pipe``: Inception Resnet v2 model trained using the MSCeleb dataset in the context of the work published by [TFP18]_
* ``opencv-pipe``: VGG Face descriptor pretrained models, i.e. `Caffe model <https://www.robots.ox.ac.uk/~vgg/software/vgg_face/>`_