          return face
  
      @staticmethod
      def find_cosine_similiarity(source_face, test_face):
          """ Find the cosine similarity between a source face and a test face """
          var_a = np.matmul(np.transpose(source_face), test_face)
          var_b = np.sum(np.multiply(source_face, source_face))
          var_c = np.sum(np.multiply(test_face, test_face))
          return 1 - (var_a / (np.sqrt(var_b) * np.sqrt(var_c)))
  
 
</s> remove         """ Sort a matrix of predictions by similarity Adapted from:
            https://gmarti.gitlab.io/ml/2017/09/07/how-to-sort-distance-matrix.html
        input:
            - predictions is a stacked matrix of vgg_face predictions shape: (x, 4096)
            - method = ["ward","single","average","complete"]
        output:
            - result_order is a list of indices with the order implied by the hierarhical tree

        sorted_similarity transforms a distance matrix into a sorted distance matrix according to
        the order implied by the hierarchical tree (dendrogram)
 </s> add         """ Sort a matrix of predictions by similarity.

        Transforms a distance matrix into a sorted distance matrix according to the order implied
        by the hierarchical tree (dendrogram).

        Parameters
        ----------
        predictions: numpy.ndarray
            A stacked matrix of vgg_face2 predictions of the shape (`N`, `D`) where `N` is the
            number of observations and `D` are the number of dimensions.  NB: The given
            :attr:`predictions` will be overwritten to save memory. If you still require the 
            original values you should take a copy prior to running this method
        method: ['single','centroid','median','ward']
            The clustering method to use.

        Returns
        -------
        list:
            List of indices with the order implied by the hierarchical tree </s> remove     def resize_face(self, face):
        """ Resize incoming face to model_input_size """
 </s> add     def _resize_face(self, face):
        """ Resize incoming face to model_input_size.

        Parameters
        ----------
        face: numpy.ndarray
            The face to be fed through the predictor. Should be in BGR channel order

        Returns
        -------
        numpy.ndarray
            The face resized to model input size
        """ </s> remove             face = self.resize_face(face)
 </s> add             face = self._resize_face(face) </s> remove         """ Return encodings for given image from vgg_face """
 </s> add         """ Return encodings for given image from vgg_face2.

        Parameters
        ----------
        face: numpy.ndarray
            The face to be fed through the predictor. Should be in BGR channel order

        Returns
        -------
        numpy.ndarray
            The encodings for the face
        """ </s> remove         linkage_required = (((item_count ** 2) * np_float) / 1.7) / divider
 </s> add         linkage_required = (((item_count ** 2) * np_float) / 1.8) / divider
        """ Find the cosine similarity between two faces.

        Parameters
        ----------
        source_face: numpy.ndarray
            The first face to test against :attr:`test_face`
        test_face: numpy.ndarray
            The second face to test against :attr:`source_face`

        Returns
        -------
        float:
            The cosine similarity between the two faces
        """
          return face
  
      @staticmethod
      def find_cosine_similiarity(source_face, test_face):
        """ Find the cosine similarity between two faces.

        Parameters
        ----------
        source_face: numpy.ndarray
            The first face to test against :attr:`test_face`
        test_face: numpy.ndarray
            The second face to test against :attr:`source_face`

        Returns
        -------
        float:
            The cosine similarity between the two faces
        """
          var_a = np.matmul(np.transpose(source_face), test_face)
          var_b = np.sum(np.multiply(source_face, source_face))
          var_c = np.sum(np.multiply(test_face, test_face))
          return 1 - (var_a / (np.sqrt(var_b) * np.sqrt(var_c)))
  
keep keep keep keep replace keep keep keep keep keep
 bugfix: tools.preview - Fix for new icons
bugfix: lib.vgg_face2_keras - Remove debug code
documentation: lib.vgg_face2_keras 
lib/vgg_face2_keras.py