code: def add_metric(self, output1, output2):
      import PIL
  
      # Output is Image
      if isinstance(output1, PIL.Image.Image):
          if output1.mode == "RGBA":
              output1 = output1.convert("RGB")
              output2 = output2.convert("RGB")
          arr1 = _np.array(output1).flatten()
          arr2 = _np.array(output2).flatten()
          snr, psnr = self._compute_snr(arr1, arr2)
          self._snr.append(snr)
          self._psnr.append(psnr)
  
      # Output is multiArray
      else:
          arr1 = output1.flatten()
          arr2 = output2.flatten()
          snr, psnr = self._compute_snr(arr1, arr2)
          self._snr.append(snr)
          self._psnr.append(psnr)
  
imports: from os import listdir
  from sys import stdout
  import numpy
  from coremltools import ComputeUnit, _logger
  from coremltools._deps import _HAS_KMEANS1D, _kmeans1d
  from coremltools.models import _QUANTIZATION_MODE_CUSTOM_LOOKUP_TABLE, _QUANTIZATION_MODE_DEQUANTIZE, _QUANTIZATION_MODE_LINEAR_QUANTIZATION, _QUANTIZATION_MODE_LINEAR_SYMMETRIC, _QUANTIZATION_MODE_LOOKUP_TABLE_KMEANS, _QUANTIZATION_MODE_LOOKUP_TABLE_LINEAR, _SUPPORTED_QUANTIZATION_MODES, MLModel
  from ...None import _MINIMUM_FP16_SPEC_VERSION, _MINIMUM_QUANTIZED_MODEL_SPEC_VERSION, _SPECIFICATION_VERSION_IOS_14
  from ..utils import _get_model, _macos_version, _wp_to_fp16wp
  from .optimization_utils import _optimize_nn
label_desc: Use image node_id 3 for calling the NoiseMetrics obj's underlying member method code with example usage: obj.add_metric(output1, output2) without return types