re-Tick commited on
Commit
d7d0192
·
verified ·
1 Parent(s): e64a955

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -33,3 +33,22 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ assets/featcolor.png filter=lfs diff=lfs merge=lfs -text
37
+ assets/featdeblur.png filter=lfs diff=lfs merge=lfs -text
38
+ assets/featscratch.png filter=lfs diff=lfs merge=lfs -text
39
+ assets/features.png filter=lfs diff=lfs merge=lfs -text
40
+ assets/revive[[:space:]]banner.png filter=lfs diff=lfs merge=lfs -text
41
+ assets/scratch1.png filter=lfs diff=lfs merge=lfs -text
42
+ assets/scratch2.png filter=lfs diff=lfs merge=lfs -text
43
+ assets/sharpen1.png filter=lfs diff=lfs merge=lfs -text
44
+ assets/sharpen2.png filter=lfs diff=lfs merge=lfs -text
45
+ before_after_examples/scratch_Removal/Example[[:space:]]1.png filter=lfs diff=lfs merge=lfs -text
46
+ before_after_examples/scratch_Removal/Example[[:space:]]2.png filter=lfs diff=lfs merge=lfs -text
47
+ before_after_examples/scratch_Removal/Example[[:space:]]3.png filter=lfs diff=lfs merge=lfs -text
48
+ before_after_examples/scratch_Removal/Example[[:space:]]4.png filter=lfs diff=lfs merge=lfs -text
49
+ before_after_examples/scratch_Removal/Example[[:space:]]5.png filter=lfs diff=lfs merge=lfs -text
50
+ before_after_examples/scratch_Removal/Example[[:space:]]6.png filter=lfs diff=lfs merge=lfs -text
51
+ before_after_examples/sharpening/Example[[:space:]]2.png filter=lfs diff=lfs merge=lfs -text
52
+ before_after_examples/sharpening/Example[[:space:]]3.png filter=lfs diff=lfs merge=lfs -text
53
+ before_after_examples/sharpening/Example1.png filter=lfs diff=lfs merge=lfs -text
54
+ notebooks/sharpening_model_notebook.ipynb filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,288 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - image-restoration
4
+ - deblurring
5
+ - sharpening
6
+ - scratch-removal
7
+ - deep-learning
8
+ - computer-vision
9
+ - tensorflow
10
+ - keras
11
+ license: mit
12
+ language: en
13
+ library_name: keras
14
+ datasets: []
15
+ metrics:
16
+ - psnr
17
+ - ssim
18
+ widget:
19
+ - src: assets/revive_banner.png
20
+ example_title: ReviveAI Example Image
21
+ inference: true
22
+ ---
23
+
24
+
25
+
26
+
27
+
28
+ # ReviveAI ✨
29
+
30
+
31
+ <p align="center">
32
+ <img src="./assets/revive banner.png" alt="ReviveAI Logo" width="50%"/>
33
+ <p align="center">
34
+ <em>Restore your memories. AI-powered image deblurring, sharpening, and scratch removal.</em>
35
+ </p>
36
+
37
+ <p align="center">
38
+ <a href="#"><img src="https://img.shields.io/badge/Build-Passing-brightgreen" alt="Build Status"></a>
39
+ <a href="link/to/your/LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue" alt="License"></a>
40
+ <a href="#"><img src="https://img.shields.io/badge/Python-3.8+-blueviolet" alt="Python Version"></a>
41
+ <a href="link/to/your/contributing/guide"><img src="https://img.shields.io/badge/Contributions-Welcome-orange" alt="Contributions Welcome"></a>
42
+ </p>
43
+
44
+ ---
45
+
46
+ ## 📖 About ReviveAI
47
+
48
+ 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.
49
+
50
+ 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.
51
+
52
+ ---
53
+
54
+ ## 🔥 Key Features
55
+ <p align = "center"><img src="./assets/features.png" alt="Features" width="100%" align = "center"/></p>
56
+
57
+ * **✅ Completed - Image Sharpening:** Enhances fine details and edges for a crisper look.
58
+ * **✅ Completed - Scratch Removal:** Intelligently detects and inpaints scratches and minor damages on photographs.
59
+ * **🛠️ Work-in-progress - Image Colorization(Coming Soon):** Adds realistic color to grayscale images.
60
+
61
+ ---
62
+
63
+ ## ✨ Before & After Showcase
64
+
65
+ See the results of ReviveAI in action!
66
+
67
+ <p align="center"> <!-- Center align the entire table block -->
68
+
69
+ | Examples | Task Performed |
70
+ | :-----------------------------------------: | :----------------- |
71
+ | <img src="./assets/sharpen1.png" alt="ReviveAI Sharp Result 1" width="650"> | Image Sharpening |
72
+ | <img src="./assets/sharpen2.png" alt="ReviveAI Sharp Result 2" width="650"> | Image Sharpening |
73
+ | <img src="./assets/scratch1.png" alt="ReviveAI Scratch Removal Result 1" width="650"> | Scratch Removal |
74
+ | <img src="./assets/scratch2.png" alt="ReviveAI Scratch Removal Result 2" width="650"> | Scratch Removal |
75
+ </p> <!-- End of center alignment -->
76
+
77
+ ---
78
+
79
+
80
+ ## 🛠️ Tech Stack
81
+
82
+ <p align="center"> <!-- Or use align="center" if you prefer -->
83
+ <a href="https://www.python.org/" target="_blank">
84
+ <img src="https://img.shields.io/badge/python-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54" alt="Python"/>
85
+ </a> 
86
+ <a href="https://www.tensorflow.org/" target="_blank">
87
+ <img src="https://img.shields.io/badge/TensorFlow-%23FF6F00.svg?style=for-the-badge&logo=TensorFlow&logoColor=white" alt="TensorFlow"/>
88
+ </a> 
89
+ <a href="https://opencv.org/" target="_blank">
90
+ <img src="https://img.shields.io/badge/opencv-%235C3EE8.svg?style=for-the-badge&logo=opencv&logoColor=white" alt="OpenCV"/>
91
+ </a> 
92
+ <a href="https://numpy.org/" target="_blank">
93
+ <img src="https://img.shields.io/badge/numpy-%23013243.svg?style=for-the-badge&logo=numpy&logoColor=white" alt="NumPy"/>
94
+ </a> 
95
+ <!-- Add more badges here if needed for GUI, Web Frameworks, etc. -->
96
+ </p>
97
+
98
+ ---
99
+
100
+
101
+ ## 📊 Implementation Status
102
+
103
+ Track the development progress of ReviveAI's key features and components:
104
+
105
+ | Feature / Component | Status | Notes / Remarks (Optional) |
106
+ | :--------------------------- | :----------------------- | :------------------------- |
107
+ | Image Deblurring/Sharpening | ✅ Completed | Core model functional |
108
+ | Scratch Removal | ✅ Completed | Core model functional |
109
+ | Image Colorization | 🚧 In Progress | Model integration underway |
110
+
111
+ ---
112
+
113
+ ## 🚀 Getting Started
114
+
115
+ Follow these steps to get ReviveAI running on your local machine or in a Jupyter/Kaggle notebook.
116
+
117
+ ### 1. Prerequisites
118
+
119
+ Ensure you have the following installed:
120
+
121
+ - Python 3.8 or above
122
+ - `pip` (Python package manager)
123
+ - Git (for cloning the repository)
124
+ - [Hugging Face CLI (optional)](https://huggingface.co/docs/huggingface_hub/quick-start)
125
+ - Jupyter Notebook or run on [Kaggle](https://kaggle.com) / [Google Colab](https://colab.research.google.com)
126
+
127
+
128
+ ---
129
+
130
+ ### 2. Clone the Repository
131
+
132
+ ```bash
133
+ git clone https://github.com/Zummya/ReviveAI.git
134
+ cd ReviveAI
135
+ ```
136
+
137
+ ---
138
+
139
+ ### 3. Set Up the Environment
140
+
141
+ We recommend using a virtual environment:
142
+
143
+ ```bash
144
+ python -m venv env
145
+ source env/bin/activate # On Windows: env\Scripts\activate
146
+ pip install -r requirements.txt
147
+ ```
148
+
149
+ ---
150
+
151
+ ## 🎯 Load Pretrained Models
152
+
153
+ All models are hosted on the Hugging Face Hub for convenience and version control.
154
+
155
+ ### 🔹 Load Image Sharpening Model
156
+
157
+ ```python
158
+ from huggingface_hub import hf_hub_download
159
+ from tensorflow.keras.models import load_model
160
+
161
+ model_path = hf_hub_download(
162
+ repo_id="Sami-on-hugging-face/RevAI_Deblur_Model",
163
+ filename="SharpeningModel_512_30Epochs.keras"
164
+ )
165
+ model = load_model(model_path, compile=False)
166
+ ```
167
+
168
+ ---
169
+
170
+ ### 🔹 Load Scratch Removal Model
171
+
172
+ ```python
173
+ from huggingface_hub import hf_hub_download
174
+ from tensorflow.keras.models import load_model
175
+
176
+ model_path = hf_hub_download(
177
+ repo_id="Sami-on-hugging-face/RevAI_Scratch_Removal_Model",
178
+ filename="scratch_removal_test2.h5"
179
+ )
180
+ model = load_model(model_path, compile=False)
181
+ ```
182
+
183
+
184
+ ---
185
+
186
+ ### 📁 Folder Structure
187
+
188
+ ```bash
189
+ ReviveAI/
190
+ │
191
+ ├── README.md
192
+ ├── .gitignore
193
+ ├── requirements.txt
194
+ │
195
+ ├── models/
196
+ │ ├── sharpening_model.txt # Hugging Face URL
197
+ │ └── scratch_removal_model.txt # Hugging Face URL
198
+ │
199
+ ├── notebooks/
200
+ │ ├── scratch_removal_notebook.ipynb
201
+ │ └── sharpening_model_notebook.ipynb
202
+ │
203
+ ├── before_after_examples/
204
+ │ ├── sharpening/
205
+ │ └── scratch_removal/
206
+ │
207
+ ├── assets/
208
+ │ └── revive banner.png, showcase images etc.
209
+
210
+ ```
211
+
212
+ ---
213
+
214
+ ## 🧪 Training & Running the Models
215
+
216
+ ReviveAI includes end-to-end Jupyter notebooks that allow you to both **train** the models from scratch and **test** them on custom images.
217
+
218
+ ### 📘 Available Notebooks
219
+
220
+ | Notebook | Description |
221
+ | -------- | ----------- |
222
+ | `sharpening_model_notebook.ipynb` | Train the sharpening (deblurring) model + Run predictions |
223
+ | `scratch_removal_notebook.ipynb` | Train the scratch removal model + Run predictions |
224
+
225
+ ---
226
+
227
+ ### 💡 Notebook Features
228
+
229
+ Each notebook includes:
230
+
231
+ - 🧠 **Model Architecture**
232
+ - 🔁 **Data Loading & Preprocessing**
233
+ - 🏋️ **Training Pipeline** (with adjustable hyperparameters)
234
+ - 💾 **Saving & Exporting Weights**
235
+ - 🔍 **Evaluation**
236
+ - 🖼️ **Visual Demo on Custom Images**
237
+
238
+ ---
239
+
240
+ ### 🖼️ Quick Test Function (for inference)
241
+
242
+ To run a prediction on a new image (after training or loading a model), use:
243
+
244
+ ```python
245
+ def display_prediction(image_path, model):
246
+ import cv2
247
+ import matplotlib.pyplot as plt
248
+ import numpy as np
249
+
250
+ img = cv2.imread(image_path)
251
+ img = cv2.resize(img, (256, 256)) / 255.0
252
+ input_img = np.expand_dims(img, axis=0)
253
+ predicted = model.predict(input_img)[0]
254
+
255
+ plt.figure(figsize=(10, 5))
256
+ plt.subplot(1, 2, 1)
257
+ plt.imshow(img[..., ::-1])
258
+ plt.title("Original Input")
259
+ plt.axis("off")
260
+
261
+ plt.subplot(1, 2, 2)
262
+ plt.imshow(predicted)
263
+ plt.title("Model Output")
264
+ plt.axis("off")
265
+
266
+ plt.show()
267
+ ```
268
+
269
+ Run the function like this:
270
+
271
+ ```python
272
+ display_prediction("your_image_path.jpg", model)
273
+ ```
274
+
275
+ ---
276
+
277
+ > ✅ 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.
278
+
279
+ <div align="center">
280
+ <h2>
281
+ <b>ReviveAI</b>
282
+ </h2>
283
+ <h3>
284
+ Made with ❤️ at <a href="https://github.com/ISTE-VIT" target="_blank">ISTE-VIT</a>
285
+ </h3>
286
+
287
+ ---
288
+ </div>
assets/.gitkeep ADDED
@@ -0,0 +1 @@
 
 
1
+ #Placeholder file to store all images
assets/featcolor.png ADDED

Git LFS Details

  • SHA256: 90690c19f95de0e6e11379616c9ca6898d33d50f307e647d0236df33271c4e1b
  • Pointer size: 131 Bytes
  • Size of remote file: 426 kB
assets/featdeblur.png ADDED

Git LFS Details

  • SHA256: 6d3fb9885798bad556a6b689cd4d2ac59681deedb3cfa3af0ad339468f9ec1db
  • Pointer size: 131 Bytes
  • Size of remote file: 460 kB
assets/featscratch.png ADDED

Git LFS Details

  • SHA256: 106afeb41808dc0c9db90dca4fd1f127c79d475050e5df5972fd3ee9c0b5b4a7
  • Pointer size: 131 Bytes
  • Size of remote file: 414 kB
assets/features.png ADDED

Git LFS Details

  • SHA256: 3856e2afeaca199152fbd763d57b4b5d05f8ad498e0023f8176c94d5cc2209ad
  • Pointer size: 132 Bytes
  • Size of remote file: 1.31 MB
assets/revive banner.png ADDED

Git LFS Details

  • SHA256: fe77506d89997a7a18120ff4a2af97f18afc61e035770083d76774ca8d788540
  • Pointer size: 131 Bytes
  • Size of remote file: 407 kB
assets/scratch1.png ADDED

Git LFS Details

  • SHA256: acfae0978e0cda99b499ac033b57c9b2cfb68ebd8ec9e7fe905bc21fcf8a6355
  • Pointer size: 131 Bytes
  • Size of remote file: 370 kB
assets/scratch2.png ADDED

Git LFS Details

  • SHA256: f11b88f89b067be8de07e8e637fa476e3a4d79858e0c9e5e3efa53a0286b4545
  • Pointer size: 131 Bytes
  • Size of remote file: 400 kB
assets/sharpen1.png ADDED

Git LFS Details

  • SHA256: 844dbb81ed6d748d734afe5753701fceeee92d7c37b4bd3de99309bb6bf96b04
  • Pointer size: 131 Bytes
  • Size of remote file: 335 kB
assets/sharpen2.png ADDED

Git LFS Details

  • SHA256: ecb8e7465bd3dee66a6d2cb1613c335c6a01d53a50463a212988b805238e3261
  • Pointer size: 131 Bytes
  • Size of remote file: 372 kB
before_after_examples/scratch_Removal/Example 1.png ADDED

Git LFS Details

  • SHA256: a93dcc74980be0258c657f0081ae126a693c0d6d7e666dbb8edcfdff65a18168
  • Pointer size: 131 Bytes
  • Size of remote file: 435 kB
before_after_examples/scratch_Removal/Example 2.png ADDED

Git LFS Details

  • SHA256: 04030a18aecc19fc998410dc62d256c56889b1fb97933a78ab25f7bebdd5c5af
  • Pointer size: 131 Bytes
  • Size of remote file: 414 kB
before_after_examples/scratch_Removal/Example 3.png ADDED

Git LFS Details

  • SHA256: 8c8665c6da5ac5f20a599dbd54fb0804a8dc2cd4d2263ca87d1498af78c67a78
  • Pointer size: 131 Bytes
  • Size of remote file: 499 kB
before_after_examples/scratch_Removal/Example 4.png ADDED

Git LFS Details

  • SHA256: 8d0c4545f6ea5d91a6817c60d499094fcca1b2335c427faf1990aa9eada916fa
  • Pointer size: 131 Bytes
  • Size of remote file: 427 kB
before_after_examples/scratch_Removal/Example 5.png ADDED

Git LFS Details

  • SHA256: 59a9e32a343b136c86dcd366a20e5d7e38f21a5549ccb284861919c57524eaa1
  • Pointer size: 131 Bytes
  • Size of remote file: 446 kB
before_after_examples/scratch_Removal/Example 6.png ADDED

Git LFS Details

  • SHA256: 90d101762f3b61a923efb7a50426d70333589096ad9fdedb6fe4f778f5215ecb
  • Pointer size: 131 Bytes
  • Size of remote file: 484 kB
before_after_examples/sharpening/Example 2.png ADDED

Git LFS Details

  • SHA256: 084d50d0003828a475fdeee94777f2f59e77ad6df7381af1cffac285b7d6e990
  • Pointer size: 131 Bytes
  • Size of remote file: 383 kB
before_after_examples/sharpening/Example 3.png ADDED

Git LFS Details

  • SHA256: a3d7dc0b5c073992ae374290ffd4eea04fa84a53ab4886c7de10cdd69b8e7895
  • Pointer size: 131 Bytes
  • Size of remote file: 473 kB
before_after_examples/sharpening/Example1.png ADDED

Git LFS Details

  • SHA256: 73fcb35571603dad0e1b47a2f498de35ed9af1f9f7acc9ec203d724c5a0dc8e9
  • Pointer size: 131 Bytes
  • Size of remote file: 362 kB
models/scratch_removal_model.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ Hugging Face Link:
2
+ https://huggingface.co/Sami-on-hugging-face/RevAI_Scratch_Removal_Model
models/sharpening_model.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ Hugging Face Link:
2
+ https://huggingface.co/Sami-on-hugging-face/RevAI_Deblur_Model
notebooks/scratch_removal_notebook.ipynb ADDED
The diff for this file is too large to render. See raw diff
 
notebooks/sharpening_model_notebook.ipynb ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:78eb29ceebc89b30f48f39dc11f8141863fd467e75a17323010c26832153d496
3
+ size 13511217
requirements.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ tensorflow
2
+ numpy
3
+ matplotlib
4
+ opencv-python
5
+ huggingface_hub