class_docstr: This masks out image regions with blurring or inpainting.
      
class_docstr_tok: ["This","masks","out","image","regions","with","blurring","or","inpainting","."]
docstr: Fill in the masked parts of the image through inpainting.
          
docstr_tok: ["Fill","in","the","masked","parts","of","the","image","through","inpainting","."]
code: def inpaint(self, x, mask, method):
      """Fill in the masked parts of the image through inpainting."""
      reshaped_mask = (
          mask.reshape(self.input_shape).astype(np.uint8).max(2)
      )
      if reshaped_mask.sum() == np.prod(self.input_shape[:-1]):
          out = x.reshape(self.input_shape).copy()
          out[:] = out.mean((0, 1))
          return out.ravel()
  
      return (
          cv2.inpaint(
              x.reshape(self.input_shape).astype(np.uint8),
              reshaped_mask,
              inpaintRadius=3,
              flags=getattr(cv2, method),
          )
          .astype(x.dtype)
          .ravel()
      )
  
file_path: shap/shap/maskers/_image.py
imports: import heapq
  import warnings
  import numba.typed
  import numpy
  from numba import njit
  from numba.core.errors import NumbaPendingDeprecationWarning
  from .._serializable import Deserializer, Serializer
  from ..utils import assert_import, record_import_error, safe_isinstance
  from ..utils._exceptions import DimensionError
  from ._masker import Masker
label_desc: Use image node_id 3 for calling the Image obj's underlying member method code with example usage: obj.inpaint(x, mask, method) and returns: cv2, out