code: def test_keras_1_image_bias(self):
      # define Keras model and get prediction
      input_shape = (100, 50, 3)
      model = Sequential()
      model.add(Activation("linear", input_shape=input_shape))
  
      data = np.ones(input_shape)
      keras_input = np.ones(input_shape)
      data[:, :, 0] = 128.0
      data[:, :, 1] = 27.0
      data[:, :, 2] = 200.0
      red_bias = -12.0
      green_bias = -20
      blue_bias = -4
      keras_input[:, :, 0] = data[:, :, 0] + red_bias
      keras_input[:, :, 1] = data[:, :, 1] + green_bias
      keras_input[:, :, 2] = data[:, :, 2] + blue_bias
  
      keras_preds = model.predict(np.expand_dims(keras_input, axis=0))
      keras_preds = np.transpose(keras_preds, [0, 3, 1, 2]).flatten()
  
      # convert to coreml and get predictions
      model_dir = tempfile.mkdtemp()
      model_path = os.path.join(model_dir, "keras.mlmodel")
      from coremltools.converters import keras as keras_converter
  
      coreml_model = keras_converter.convert(
          model,
          input_names=["data"],
          output_names=["output"],
          image_input_names=["data"],
          red_bias=red_bias,
          green_bias=green_bias,
          blue_bias=blue_bias,
      )
  
      if _is_macos() and _macos_version() >= (10, 13):
          coreml_input_dict = dict()
          coreml_input_dict["data"] = PIL.Image.fromarray(
              data.astype(np.uint8)
          )
          coreml_preds = coreml_model.predict(coreml_input_dict)[
              "output"
          ].flatten()
  
          self.assertEquals(len(keras_preds), len(coreml_preds))
          max_relative_error = compare_models(keras_preds, coreml_preds)
          self.assertAlmostEquals(
              max(max_relative_error, 0.001), 0.001, delta=1e-6
          )
  
      if os.path.exists(model_dir):
          shutil.rmtree(model_dir)
  
imports: from __future__ import print_function
  import json
  import os
  import shutil
  import subprocess
  import tarfile
  import tempfile
  import unittest
  from subprocess import Popen
  import PIL.Image
  import numpy
  import pytest
  import coremltools
  from coremltools._deps import _HAS_KERAS2_TF
  from coremltools.models.utils import _macos_version, _is_macos
label_desc: Use image node_id 1 for calling the ManyImagesKeras obj's underlying member method code with example usage: obj.test_keras_1_image_bias() without return types