Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
tags:
|
| 4 |
+
- image-segmentation
|
| 5 |
+
- watermark-removal
|
| 6 |
+
- pytorch
|
| 7 |
+
- unet
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
# Watermark Remover - Segmentation Model
|
| 11 |
+
|
| 12 |
+
UNet++ segmentation model for detecting watermarks in images.
|
| 13 |
+
|
| 14 |
+
## Model Details
|
| 15 |
+
|
| 16 |
+
- **Architecture**: UNet++ with EfficientNet-B4 encoder
|
| 17 |
+
- **Framework**: PyTorch + segmentation-models-pytorch
|
| 18 |
+
- **Training**: Modal GPU (T4)
|
| 19 |
+
- **Current checkpoint**: Banana/Gemini provider (epoch 48, val_iou=97.44%)
|
| 20 |
+
|
| 21 |
+
## Usage
|
| 22 |
+
|
| 23 |
+
```python
|
| 24 |
+
import torch
|
| 25 |
+
import segmentation_models_pytorch as smp
|
| 26 |
+
from huggingface_hub import hf_hub_download
|
| 27 |
+
|
| 28 |
+
# Download weights
|
| 29 |
+
weights_path = hf_hub_download(
|
| 30 |
+
repo_id="christophernavas/watermark-remover",
|
| 31 |
+
filename="segmenter.pth"
|
| 32 |
+
)
|
| 33 |
+
|
| 34 |
+
# Load model
|
| 35 |
+
model = smp.UnetPlusPlus(
|
| 36 |
+
encoder_name="efficientnet-b4",
|
| 37 |
+
encoder_weights=None,
|
| 38 |
+
in_channels=3,
|
| 39 |
+
classes=1,
|
| 40 |
+
activation=None,
|
| 41 |
+
)
|
| 42 |
+
model.load_state_dict(torch.load(weights_path, map_location="cpu"))
|
| 43 |
+
model.eval()
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
## Performance
|
| 47 |
+
|
| 48 |
+
| Provider | Detection Rate | val_iou |
|
| 49 |
+
|----------|---------------|---------|
|
| 50 |
+
| Banana/Gemini | 95% (20/21) | 97.44% |
|
| 51 |
+
|
| 52 |
+
## License
|
| 53 |
+
|
| 54 |
+
MIT
|