maxim s3 deblurring reds

google

Introduction

The MAXIM model is pre-trained for image deblurring, introduced in the paper "MAXIM: Multi-Axis MLP for Image Processing" by Zhengzhong Tu et al. It features a shared MLP-based backbone suitable for various image processing tasks, including deblurring, deraining, denoising, dehazing, and enhancement.

Architecture

MAXIM employs a shared MLP-based backbone architecture designed to handle multiple image processing tasks efficiently. The model's main components focus on leveraging multi-axis operations to enhance image quality across different use cases.

Training

The training code for MAXIM is not publicly available. For training details, refer to the original paper. The model achieves a PSNR of 28.93 and an SSIM of 0.865, indicating its effectiveness in image deblurring tasks.

Guide: Running Locally

To run the MAXIM model locally for image deblurring, follow these steps:

  1. Install Dependencies: Ensure you have TensorFlow and required libraries installed.
  2. Load Image: Use the PIL library to load and preprocess your image.
  3. Resize Image: Convert the image to a TensorFlow tensor and resize it to the required dimensions (256x256).
  4. Load Model: Use the from_pretrained_keras method from Hugging Face to load the pre-trained MAXIM model.
  5. Predict: Run the model's predict method to get deblurred image predictions.
from huggingface_hub import from_pretrained_keras
from PIL import Image
import tensorflow as tf
import numpy as np
import requests

url = "https://github.com/sayakpaul/maxim-tf/blob/main/images/Deblurring/input/109fromGOPR1096.MP4.png?raw=true"
image = Image.open(requests.get(url, stream=True).raw)
image = np.array(image)
image = tf.convert_to_tensor(image)
image = tf.image.resize(image, (256, 256))

model = from_pretrained_keras("google/maxim-s3-deblurring-reds")
predictions = model.predict(tf.expand_dims(image, 0))

For enhanced performance, consider using cloud GPU services like Google Colab, AWS, or Azure.

License

The MAXIM model is released under the Apache-2.0 license, allowing for both academic and commercial use with proper attribution.

More Related APIs in Image To Image