nehulagrawal commited on
Commit
4096dee
·
verified ·
1 Parent(s): 1fd7cfd

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +119 -3
README.md CHANGED
@@ -1,3 +1,119 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - watermark-removal
4
+ - image-enhancement
5
+ - watermark-removal
6
+ - image-deblurring
7
+ - watermark-cleaner
8
+ - ai-image-enhancement
9
+ - watermarked-image-processing
10
+ - watermark-free-images
11
+ - image-restoration
12
+ - neural-networks
13
+ - computer-vision
14
+ - watermark-remover
15
+ - image-processing
16
+ - image-reconstruction
17
+ - supervised-learning
18
+
19
+ license: apache-2.0
20
+ language:
21
+ - en
22
+ ---
23
+
24
+ # Watermark Removal Model
25
+
26
+ ## Model Summary
27
+ The Watermark Removal model is an image processing model based on neural networks. It is designed to remove watermarks from images while preserving the original image quality. The model utilizes an encoder-decoder structure with skip connections to maintain fine details during the watermark removal process.
28
+
29
+ <div align="center">
30
+ <img width="640" alt="foduucom/Watermark_Removal" src="https://huggingface.co/foduucom/Watermark_Removal/resolve/main/output.png">
31
+ </div>
32
+
33
+ ## Model Details
34
+
35
+ ### Model Description
36
+ - **Developed by:** FODUU AI
37
+ - **Model type:** Computer Vision - Image Processing
38
+ - **Task:** Remove watermark from image
39
+
40
+ ## Usage Guide
41
+
42
+ ### Installation Requirements
43
+ ```bash
44
+ pip install torch torchvision
45
+ pip install Pillow matplotlib numpy
46
+ ```
47
+ or you can run :
48
+ ```bash
49
+ pip install -r requirements.txt
50
+ ```
51
+
52
+ ### Model Loading and Inference
53
+ ```python
54
+ import torch
55
+ from torchvision import transforms
56
+ from PIL import Image
57
+ from watermark_remover import WatermarkRemover
58
+ import numpy as np
59
+
60
+ image_path = "path to your test image" # Replace with the path to your test image
61
+ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
62
+
63
+ # Load the trained model
64
+ model = WatermarkRemover().to(device)
65
+ model_path = "path to your model.pth" # Replace with the path to your saved model
66
+ model.load_state_dict(torch.load(model_path, map_location=device))
67
+ model.eval()
68
+
69
+ transform = transforms.Compose([transforms.Resize((256, 256)),
70
+ transforms.ToTensor(),])
71
+ watermarked_image = Image.open(image_path).convert("RGB")
72
+ original_size = watermarked_image.size
73
+ input_tensor = transform(watermarked_image).unsqueeze(0).to(device)
74
+
75
+ with torch.no_grad():
76
+ output_tensor = model(input_tensor)
77
+
78
+ predicted_image = output_tensor.squeeze(0).cpu().permute(1, 2, 0).clamp(0, 1).numpy()
79
+ predicted_pil = Image.fromarray((predicted_image * 255).astype(np.uint8))
80
+ predicted_pil = predicted_pil.resize(original_size, Image.Resampling.LANCZOS)
81
+ predicted_pil.save("predicted_image.jpg", quality=100)
82
+
83
+
84
+ ```
85
+
86
+ ## Limitations and Considerations
87
+ - Performance may vary depending on watermark complexity and opacity
88
+ - Best results achieved with semi-transparent watermarks
89
+ - Model trained on 256x256 images; performance may vary with different resolutions
90
+ - GPU recommended for faster inference
91
+
92
+ ### Training Details
93
+ - **Dataset**: The model was trained on a custom dataset consisting of 20,000 images with watermarks in various styles and intensities.
94
+ - **Training Time**: The model was trained for 200 epochs on an NVIDIA GeForce RTX 3060 GPU.
95
+ - **Loss Function**: The model uses a combination of MSE (Mean Squared Error) and perceptual loss to optimize watermark removal quality.
96
+
97
+ ### Model Evaluation
98
+ The model has been evaluated using Peak Signal-to-Noise Ratio (PSNR) and Structural Similarity Index (SSIM) on a test set of watermarked images, achieving an average PSNR of 30.5 dB and an SSIM of 0.92.
99
+
100
+
101
+ ## Compute Infrastructure
102
+
103
+ ### Hardware
104
+ NVIDIA GeForce RTX 3060 card
105
+
106
+ ### Software
107
+ The model was trained on Jupyter Notebook environment.
108
+
109
+ ### Model Card Contact
110
+ For inquiries and contributions, please contact us at [email protected]
111
+
112
+ ```bibtex
113
+ @ModelCard{
114
+ author = {Nehul Agrawal and
115
+ Priyal Mehta},
116
+ title = {Watermark Removal Using Neural Networks},
117
+ year = {2025}
118
+ }
119
+ ```