re-Tick commited on
Commit
b116045
·
verified ·
1 Parent(s): a53f1e7

Upload folder using huggingface_hub

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