import tensorflow as tf


    def __init__(self, config):
        # Import TF-Hub module
        self.hub_module = hub.load("https://tfhub.dev/captain-pool/esrgan-tf2/1")

    def predict(self, payload):
        # Preprocess image
        hr_image = preprocess_image(payload["image_b64"])

        # Run model
        fake_image = self.hub_module(hr_image)

        # convert to base64
        img = get_image(tf.squeeze(fake_image))
        im_file = io.BytesIO()
        img.save(im_file, format="PNG")
        im_bytes = base64.b64encode(im_file.getvalue()).decode("utf-8")

        return im_bytes
