          return item
  
      def _predict(self, batch):
          """ Just return the masker's predict function """
          return self.predict(batch)
  
      def finalize(self, batch):
          """ Finalize the output from Masker
  
          This should be called as the final task of each `plugin`.
 
</s> remove         return self.predict(batch)
 </s> add         try:
            return self.predict(batch)
        except tf_errors.ResourceExhaustedError as err:
            msg = ("You do not have enough GPU memory available to run detection at the "
                   "selected batch size. You can try a number of things:"
                   "\n1) Close any other application that is using your GPU (web browsers are "
                   "particularly bad for this)."
                   "\n2) Lower the batchsize (the amount of images fed into the model) by "
                   "editing the plugin settings (GUI: Settings > Configure extract settings, "
                   "CLI: Edit the file faceswap/config/extract.ini)."
                   "\n3) Enable 'Single Process' mode.")
            raise FaceswapError(msg) from err
        except Exception as err:
            if get_backend() == "amd":
                # pylint:disable=import-outside-toplevel
                from lib.plaidml_utils import is_plaidml_error
                if (is_plaidml_error(err) and (
                        "CL_MEM_OBJECT_ALLOCATION_FAILURE" in str(err).upper() or
                        "enough memory for the current schedule" in str(err).lower())):
                    msg = ("You do not have enough GPU memory available to run detection at "
                           "the selected batch size. You can try a number of things:"
                           "\n1) Close any other application that is using your GPU (web "
                           "browsers are particularly bad for this)."
                           "\n2) Lower the batchsize (the amount of images fed into the "
                           "model) by editing the plugin settings (GUI: Settings > Configure "
                           "extract settings, CLI: Edit the file "
                           "faceswap/config/extract.ini).")
                    raise FaceswapError(msg) from err
            raise </s> remove             batch = self.predict(batch)
 </s> add             try:
                batch = self.predict(batch)
            except tf_errors.ResourceExhaustedError as err:
                msg = ("You do not have enough GPU memory available to run detection at the "
                       "selected batch size. You can try a number of things:"
                       "\n1) Close any other application that is using your GPU (web browsers are "
                       "particularly bad for this)."
                       "\n2) Lower the batchsize (the amount of images fed into the model) by "
                       "editing the plugin settings (GUI: Settings > Configure extract settings, "
                       "CLI: Edit the file faceswap/config/extract.ini)."
                       "\n3) Enable 'Single Process' mode.")
                raise FaceswapError(msg) from err
            except Exception as err:
                if get_backend() == "amd":
                    # pylint:disable=import-outside-toplevel
                    from lib.plaidml_utils import is_plaidml_error
                    if (is_plaidml_error(err) and (
                            "CL_MEM_OBJECT_ALLOCATION_FAILURE" in str(err).upper() or
                            "enough memory for the current schedule" in str(err).lower())):
                        msg = ("You do not have enough GPU memory available to run detection at "
                               "the selected batch size. You can try a number of things:"
                               "\n1) Close any other application that is using your GPU (web "
                               "browsers are particularly bad for this)."
                               "\n2) Lower the batchsize (the amount of images fed into the "
                               "model) by editing the plugin settings (GUI: Settings > Configure "
                               "extract settings, CLI: Edit the file "
                               "faceswap/config/extract.ini).")
                        raise FaceswapError(msg) from err
                raise
        try:
            return self.predict(batch)
        except tf_errors.ResourceExhaustedError as err:
            msg = ("You do not have enough GPU memory available to run detection at the "
                   "selected batch size. You can try a number of things:"
                   "\n1) Close any other application that is using your GPU (web browsers are "
                   "particularly bad for this)."
                   "\n2) Lower the batchsize (the amount of images fed into the model) by "
                   "editing the plugin settings (GUI: Settings > Configure extract settings, "
                   "CLI: Edit the file faceswap/config/extract.ini)."
                   "\n3) Enable 'Single Process' mode.")
            raise FaceswapError(msg) from err
        except Exception as err:
            if get_backend() == "amd":
                # pylint:disable=import-outside-toplevel
                from lib.plaidml_utils import is_plaidml_error
                if (is_plaidml_error(err) and (
                        "CL_MEM_OBJECT_ALLOCATION_FAILURE" in str(err).upper() or
                        "enough memory for the current schedule" in str(err).lower())):
                    msg = ("You do not have enough GPU memory available to run detection at "
                           "the selected batch size. You can try a number of things:"
                           "\n1) Close any other application that is using your GPU (web "
                           "browsers are particularly bad for this)."
                           "\n2) Lower the batchsize (the amount of images fed into the "
                           "model) by editing the plugin settings (GUI: Settings > Configure "
                           "extract settings, CLI: Edit the file "
                           "faceswap/config/extract.ini).")
                    raise FaceswapError(msg) from err
            raise
          return item
  
      def _predict(self, batch):
          """ Just return the masker's predict function """
        try:
            return self.predict(batch)
        except tf_errors.ResourceExhaustedError as err:
            msg = ("You do not have enough GPU memory available to run detection at the "
                   "selected batch size. You can try a number of things:"
                   "\n1) Close any other application that is using your GPU (web browsers are "
                   "particularly bad for this)."
                   "\n2) Lower the batchsize (the amount of images fed into the model) by "
                   "editing the plugin settings (GUI: Settings > Configure extract settings, "
                   "CLI: Edit the file faceswap/config/extract.ini)."
                   "\n3) Enable 'Single Process' mode.")
            raise FaceswapError(msg) from err
        except Exception as err:
            if get_backend() == "amd":
                # pylint:disable=import-outside-toplevel
                from lib.plaidml_utils import is_plaidml_error
                if (is_plaidml_error(err) and (
                        "CL_MEM_OBJECT_ALLOCATION_FAILURE" in str(err).upper() or
                        "enough memory for the current schedule" in str(err).lower())):
                    msg = ("You do not have enough GPU memory available to run detection at "
                           "the selected batch size. You can try a number of things:"
                           "\n1) Close any other application that is using your GPU (web "
                           "browsers are particularly bad for this)."
                           "\n2) Lower the batchsize (the amount of images fed into the "
                           "model) by editing the plugin settings (GUI: Settings > Configure "
                           "extract settings, CLI: Edit the file "
                           "faceswap/config/extract.ini).")
                    raise FaceswapError(msg) from err
            raise
  
      def finalize(self, batch):
          """ Finalize the output from Masker
  
          This should be called as the final task of each `plugin`.
keep keep keep keep replace keep keep keep keep keep
 Catch OOM Errors on Extract 
plugins/extract/mask/_base.py