ReviveAI ✨
ReviveAI Logo
Restore your memories. AI-powered image deblurring, sharpening, and scratch removal.
📖 About ReviveAI
ReviveAI leverages the power of Artificial Intelligence to breathe new life into your old or degraded photographs. Whether it's blurriness from camera shake, general lack of sharpness, or physical damage like scratches, ReviveAI aims to restore clarity and detail, preserving your precious moments.
This project utilizes state-of-the-art deep learning models trained specifically for image restoration tasks. Our goal is to provide an accessible tool for enhancing image quality significantly.
🔥 Key Features
Features
✅ Completed - Image Sharpening: Enhances fine details and edges for a crisper look.
✅ Completed - Scratch Removal: Intelligently detects and inpaints scratches and minor damages on photographs.
🛠️ Work-in-progress - Image Colorization(Coming Soon): Adds realistic color to grayscale images.
✨ Before & After Showcase
See the results of ReviveAI in action!
Examples Task Performed ReviveAI Sharp Result 1 Image Sharpening ReviveAI Sharp Result 2 Image Sharpening ReviveAI Scratch Removal Result 1 Scratch Removal ReviveAI Scratch Removal Result 2 Scratch Removal
🛠️ Tech Stack
📊 Implementation Status
Track the development progress of ReviveAI's key features and components:
Feature / Component Status Notes / Remarks (Optional) Image Deblurring/Sharpening ✅ Completed Core model functional Scratch Removal ✅ Completed Core model functional Image Colorization 🚧 In Progress Model integration underway
🚀 Getting Started
Follow these steps to get ReviveAI running on your local machine or in a Jupyter/Kaggle notebook.
1. Prerequisites
Ensure you have the following installed:
Python 3.8 or above
pip (Python package manager)
Git (for cloning the repository)
Hugging Face CLI (optional)
Jupyter Notebook or run on Kaggle / Google Colab
2. Clone the Repository
1 git clone https://github.com/Zummya/ReviveAI.git
2 cd ReviveAI
3. Set Up the Environment
We recommend using a virtual environment:
1 python -m venv env
2 source env/bin/activate # On Windows: env\Scripts\activate
3 pip install -r requirements.txt
🎯 Load Pretrained Models
All models are hosted on the Hugging Face Hub for convenience and version control.
🔹 Load Image Sharpening Model
1 from huggingface_hub import hf_hub_download
2 from tensorflow . keras . models import load_model
3
4 model_path = hf_hub_download (
5 repo_id = "Sami-on-hugging-face/RevAI_Deblur_Model" ,
6 filename = "SharpeningModel_512_30Epochs.keras"
7 )
8 model = load_model ( model_path , compile = False )
🔹 Load Scratch Removal Model
1 from huggingface_hub import hf_hub_download
2 from tensorflow . keras . models import load_model
3
4 model_path = hf_hub_download (
5 repo_id = "Sami-on-hugging-face/RevAI_Scratch_Removal_Model" ,
6 filename = "scratch_removal_test2.h5"
7 )
8 model = load_model ( model_path , compile = False )
📁 Folder Structure
1 ReviveAI/
2 │
3 ├── README.md
4 ├── .gitignore
5 ├── requirements.txt
6 │
7 ├── models/
8 │ ├── sharpening_model.txt # Hugging Face URL
9 │ └── scratch_removal_model.txt # Hugging Face URL
10 │
11 ├── notebooks/
12 │ ├── scratch_removal_notebook.ipynb
13 │ └── sharpening_model_notebook.ipynb
14 │
15 ├── before_after_examples/
16 │ ├── sharpening/
17 │ └── scratch_removal/
18 │
19 ├── assets/
20 │ └── revive banner.png, showcase images etc.
21
🧪 Training & Running the Models
ReviveAI includes end-to-end Jupyter notebooks that allow you to both train the models from scratch and test them on custom images.
📘 Available Notebooks
Notebook Description sharpening_model_notebook.ipynbTrain the sharpening (deblurring) model + Run predictions scratch_removal_notebook.ipynbTrain the scratch removal model + Run predictions
💡 Notebook Features
Each notebook includes:
🧠 Model Architecture
🔁 Data Loading & Preprocessing
🏋️ Training Pipeline (with adjustable hyperparameters)
💾 Saving & Exporting Weights
🔍 Evaluation
🖼️ Visual Demo on Custom Images
🖼️ Quick Test Function (for inference)
To run a prediction on a new image (after training or loading a model), use:
1 def display_prediction ( image_path , model ) :
2 import cv2
3 import matplotlib . pyplot as plt
4 import numpy as np
5
6 img = cv2 . imread ( image_path )
7 img = cv2 . resize ( img , ( 256 , 256 ) ) / 255.0
8 input_img = np . expand_dims ( img , axis = 0 )
9 predicted = model . predict ( input_img ) [ 0 ]
10
11 plt . figure ( figsize = ( 10 , 5 ) )
12 plt . subplot ( 1 , 2 , 1 )
13 plt . imshow ( img [ . . . , : : - 1 ] )
14 plt . title ( "Original Input" )
15 plt . axis ( "off" )
16
17 plt . subplot ( 1 , 2 , 2 )
18 plt . imshow ( predicted )
19 plt . title ( "Model Output" )
20 plt . axis ( "off" )
21
22 plt . show ( )
Run the function like this:
display_prediction("your_image_path.jpg", model)
✅ Tip: If you don't want to train from scratch, you can directly load pretrained weights from Hugging Face (see
🎯 Load Pretrained Models ) and skip to the testing section.