--- tags: - image-restoration - deblurring - sharpening - scratch-removal - deep-learning - computer-vision - tensorflow - keras license: mit language: en library_name: keras datasets: [] metrics: - psnr - ssim widget: - src: assets/revive_banner.png example_title: ReviveAI Example Image inference: true --- # ReviveAI โœจ

ReviveAI Logo

Restore your memories. AI-powered image deblurring, sharpening, and scratch removal.

Build Status License Python Version Contributions Welcome

--- ## ๐Ÿ“– 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

Python ย  TensorFlow ย  OpenCV ย  NumPy ย 

--- ## ๐Ÿ“Š 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)](https://huggingface.co/docs/huggingface_hub/quick-start) - Jupyter Notebook or run on [Kaggle](https://kaggle.com) / [Google Colab](https://colab.research.google.com) --- ### 2. Clone the Repository ```bash git clone https://github.com/Zummya/ReviveAI.git cd ReviveAI ``` --- ### 3. Set Up the Environment We recommend using a virtual environment: ```bash python -m venv env source env/bin/activate # On Windows: env\Scripts\activate 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 ```python from huggingface_hub import hf_hub_download from tensorflow.keras.models import load_model model_path = hf_hub_download( repo_id="Sami-on-hugging-face/RevAI_Deblur_Model", filename="SharpeningModel_512_30Epochs.keras" ) model = load_model(model_path, compile=False) ``` --- ### ๐Ÿ”น Load Scratch Removal Model ```python from huggingface_hub import hf_hub_download from tensorflow.keras.models import load_model model_path = hf_hub_download( repo_id="Sami-on-hugging-face/RevAI_Scratch_Removal_Model", filename="scratch_removal_test2.h5" ) model = load_model(model_path, compile=False) ``` --- ### ๐Ÿ“ Folder Structure ```bash ReviveAI/ โ”‚ โ”œโ”€โ”€ README.md โ”œโ”€โ”€ .gitignore โ”œโ”€โ”€ requirements.txt โ”‚ โ”œโ”€โ”€ models/ โ”‚ โ”œโ”€โ”€ sharpening_model.txt # Hugging Face URL โ”‚ โ””โ”€โ”€ scratch_removal_model.txt # Hugging Face URL โ”‚ โ”œโ”€โ”€ notebooks/ โ”‚ โ”œโ”€โ”€ scratch_removal_notebook.ipynb โ”‚ โ””โ”€โ”€ sharpening_model_notebook.ipynb โ”‚ โ”œโ”€โ”€ before_after_examples/ โ”‚ โ”œโ”€โ”€ sharpening/ โ”‚ โ””โ”€โ”€ scratch_removal/ โ”‚ โ”œโ”€โ”€ assets/ โ”‚ โ””โ”€โ”€ revive banner.png, showcase images etc. ``` --- ## ๐Ÿงช 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.ipynb` | Train the sharpening (deblurring) model + Run predictions | | `scratch_removal_notebook.ipynb` | Train 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: ```python def display_prediction(image_path, model): import cv2 import matplotlib.pyplot as plt import numpy as np img = cv2.imread(image_path) img = cv2.resize(img, (256, 256)) / 255.0 input_img = np.expand_dims(img, axis=0) predicted = model.predict(input_img)[0] plt.figure(figsize=(10, 5)) plt.subplot(1, 2, 1) plt.imshow(img[..., ::-1]) plt.title("Original Input") plt.axis("off") plt.subplot(1, 2, 2) plt.imshow(predicted) plt.title("Model Output") plt.axis("off") plt.show() ``` Run the function like this: ```python 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](#-load-pretrained-models)) and skip to the testing section.

ReviveAI

Made with โค๏ธ at ISTE-VIT

---