      def predict(self, face):
          """ Return encodings for given image from vgg_face """
          if face.shape[0] != self.input_size:
              face = self.resize_face(face)
          blob = cv2.dnn.blobFromImage(face,  # pylint: disable=no-member
                                       1.0,
                                       (self.input_size, self.input_size),
                                       self.average_img,
                                       False,
                                       False)
 
</s> remove         face = np.expand_dims(face - self.average_img, axis=0)
 </s> add         face = face[None, :, :, :3] - self.average_img </s> remove             images = np.array([cv2.addWeighted(img, 1.0,  # pylint: disable=no-member
                                               masks3[idx], 0.3,
                                               0)
 </s> add             images = np.array([cv2.addWeighted(img,  # pylint: disable=no-member
                                               1.0, masks3[idx], 0.3, 0) </s> remove         retval = bool(self.model.training_opts.get("mask_type", None))
 </s> add         retval = (self.model.training_opts.get("replicate_input_mask", False) or
                  self.model.training_opts.get("penalized_mask_loss", True)) </s> remove         self.image = image[self.top: self.bottom,
 </s> add         self.face = image[self.top: self.bottom,
        blob = cv2.dnn.blobFromImage(face[..., :3],  # pylint: disable=no-member
      def predict(self, face):
          """ Return encodings for given image from vgg_face """
          if face.shape[0] != self.input_size:
              face = self.resize_face(face)
        blob = cv2.dnn.blobFromImage(face[..., :3],  # pylint: disable=no-member
                                       1.0,
                                       (self.input_size, self.input_size),
                                       self.average_img,
                                       False,
                                       False)
keep keep keep keep replace keep keep keep keep keep
 Smart Mask Exposure for Extraction & Training (#831)

Smart Masks - Initial Commit 
lib/vgg_face.py