Paper: https://arxiv.org/abs/2410.17064
This project is an extension of the KernelGAN framework, originally developed by Sefi Bell-Kligler, Assaf Shocher, and Michal Irani. Additionally, this work leverages the Segment Anything Model (SAM) for image segmentation and YOLOv8 for object detection, creating an enhanced super-resolution pipeline with multiple kernel estimations.
This notebook implements the original KernelGAN combined with Zero-Shot Super-Resolution (ZSSR). It estimates the kernel of a low-resolution input image and performs super-resolution based on the estimated kernel.
Steps to run:
- Open the notebook using the Colab badge above.
- Create two directories named
input
andoutput
in the notebook environment. - Upload your low-resolution image into the
input
folder. - Run the steps in the notebook to estimate the image kernel and apply the ZSSR algorithm.
- The super-resolved output will be saved in the
output
folder.
This notebook uses Facebook’s Segment Anything Model (SAM) to generate object segmentation masks, which will later be used in the Multi-KernelGAN pipeline.
Steps to run:
- Open the notebook via the Colab badge.
- Ensure you have a directory in your Google Drive named
KernelGAN-Masks
, with two subfolders:imgs
(for input images) andmasks
(for output masks). - Upload the images you wish to process into the
imgs
folder. For each image, there should be two versions: one low-resolution (LR) and one high-resolution (HR). - The notebook will generate segmentation masks for the objects in the images using SAM.
- The output masks will be stored in the
masks
folder, ready for use in subsequent steps of the pipeline.
This notebook combines Multi-KernelGAN with ZSSR. It segments the image into different regions using object detection and segmentation, estimates multiple kernels for those regions, and applies ZSSR to each region separately for improved super-resolution results.
Steps to run:
- First, run the Mask Generation with SAM notebook to generate object segmentation masks.
- Open the Multi-KernelGAN notebook by clicking the Colab badge above.
- Add three more subfolders in the
KernelGAN-Masks
directory:code
for storing the code needed to execute Multi-KernelGAN (View Code Folder).weights
for saving model weights.exps
for storing the experiment results.
- The notebook will execute the Multi-KernelGAN process on each segmented region of the image. The results, including super-resolved regions, will be saved in the
exps
folder. - The final output will be a composite image where each segmented region is super-resolved, stored in the
exps
folder.