parameters: (self)
return_statement: return self._mask
docstring: Create binary mask from the png file.
          :return: <np.int8: image.height, image.width>.
docstring_summary: Create binary mask from the png file.
          :return: <np.int8: image.height, image.width>.
docstring_tokens: Create binary mask from the png file . : return : <np . int8 : image . height image . width > .
function: def mask(self):
          """
          Create binary mask from the png file.
          :return: <np.int8: image.height, image.width>.
          """
          if self._mask is None:
              img = cv2.imread(self.img_file, cv2.IMREAD_GRAYSCALE)
              self._mask = np.array(img)
              self._mask[self._mask < 225] = self.background
              self._mask[self._mask >= 225] = self.foreground
  
          return self._mask
function_tokens: def mask ( self ) : if self . _mask is None : img = cv2 . imread ( self . img_file , cv2 . IMREAD_GRAYSCALE ) self . _mask = np . array ( img ) self . _mask [ self . _mask < 225 ] = self . background self . _mask [ self . _mask >= 225 ] = self . foreground return self . _mask