Jai Sharma
commited on
Commit
·
989d134
1
Parent(s):
c558b49
changes
Browse files- README.md +170 -0
- checkpoint-1424/config.json +46 -0
- checkpoint-1424/preprocessor_config.json +24 -0
- checkpoint-1424/rng_state.pth +3 -0
- checkpoint-1424/scheduler.pt +3 -0
- checkpoint-1424/trainer_state.json +68 -0
- checkpoint-1424/training_args.bin +3 -0
- checkpoint-712/config.json +46 -0
- checkpoint-712/preprocessor_config.json +24 -0
- checkpoint-712/rng_state.pth +3 -0
- checkpoint-712/scheduler.pt +3 -0
- checkpoint-712/trainer_state.json +51 -0
- checkpoint-712/training_args.bin +3 -0
- config.json +46 -0
- preprocessor_config.json +24 -0
- training_args.bin +3 -0
README.md
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
datasets:
|
| 4 |
+
- qwertyforce/scenery_watermarks
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
base_model:
|
| 8 |
+
- google/siglip2-base-patch16-224
|
| 9 |
+
pipeline_tag: image-classification
|
| 10 |
+
library_name: transformers
|
| 11 |
+
tags:
|
| 12 |
+
- Image-Classification
|
| 13 |
+
- Watermark-Detection
|
| 14 |
+
- SigLIP2
|
| 15 |
+
|
| 16 |
+
---
|
| 17 |
+
|
| 18 |
+

|
| 19 |
+
|
| 20 |
+
# **Watermark-Detection-SigLIP2**
|
| 21 |
+
|
| 22 |
+
> **Watermark-Detection-SigLIP2** is a vision-language encoder model fine-tuned from **google/siglip2-base-patch16-224** for **binary image classification**. It is trained to detect whether an image **contains a watermark or not**, using the **SiglipForImageClassification** architecture.
|
| 23 |
+
|
| 24 |
+
> [!note]
|
| 25 |
+
> Watermark detection works best with crisp and high-quality images. Noisy images are not recommended for validation.
|
| 26 |
+
|
| 27 |
+
> [!note]
|
| 28 |
+
*SigLIP 2: Multilingual Vision-Language Encoders with Improved Semantic Understanding, Localization, and Dense Features* https://arxiv.org/pdf/2502.14786
|
| 29 |
+
|
| 30 |
+
```py
|
| 31 |
+
Classification Report:
|
| 32 |
+
precision recall f1-score support
|
| 33 |
+
|
| 34 |
+
No Watermark 0.9290 0.9722 0.9501 12779
|
| 35 |
+
Watermark 0.9622 0.9048 0.9326 9983
|
| 36 |
+
|
| 37 |
+
accuracy 0.9427 22762
|
| 38 |
+
macro avg 0.9456 0.9385 0.9414 22762
|
| 39 |
+
weighted avg 0.9435 0.9427 0.9424 22762
|
| 40 |
+
```
|
| 41 |
+
|
| 42 |
+

|
| 43 |
+
|
| 44 |
+
---
|
| 45 |
+
|
| 46 |
+
## **Label Space: 2 Classes**
|
| 47 |
+
|
| 48 |
+
The model classifies an image as either:
|
| 49 |
+
|
| 50 |
+
```
|
| 51 |
+
Class 0: "No Watermark"
|
| 52 |
+
Class 1: "Watermark"
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
---
|
| 56 |
+
|
| 57 |
+
## **Install dependencies**
|
| 58 |
+
|
| 59 |
+
```bash
|
| 60 |
+
pip install -q transformers torch pillow gradio
|
| 61 |
+
```
|
| 62 |
+
|
| 63 |
+
---
|
| 64 |
+
|
| 65 |
+
## **Inference Code**
|
| 66 |
+
|
| 67 |
+
```python
|
| 68 |
+
import gradio as gr
|
| 69 |
+
from transformers import AutoImageProcessor, SiglipForImageClassification
|
| 70 |
+
from PIL import Image
|
| 71 |
+
import torch
|
| 72 |
+
|
| 73 |
+
# Load model and processor
|
| 74 |
+
model_name = "prithivMLmods/Watermark-Detection-SigLIP2" # Update this if using a different path
|
| 75 |
+
model = SiglipForImageClassification.from_pretrained(model_name)
|
| 76 |
+
processor = AutoImageProcessor.from_pretrained(model_name)
|
| 77 |
+
|
| 78 |
+
# Label mapping
|
| 79 |
+
id2label = {
|
| 80 |
+
"0": "No Watermark",
|
| 81 |
+
"1": "Watermark"
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
def classify_watermark(image):
|
| 85 |
+
image = Image.fromarray(image).convert("RGB")
|
| 86 |
+
inputs = processor(images=image, return_tensors="pt")
|
| 87 |
+
|
| 88 |
+
with torch.no_grad():
|
| 89 |
+
outputs = model(**inputs)
|
| 90 |
+
logits = outputs.logits
|
| 91 |
+
probs = torch.nn.functional.softmax(logits, dim=1).squeeze().tolist()
|
| 92 |
+
|
| 93 |
+
prediction = {
|
| 94 |
+
id2label[str(i)]: round(probs[i], 3) for i in range(len(probs))
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
return prediction
|
| 98 |
+
|
| 99 |
+
# Gradio Interface
|
| 100 |
+
iface = gr.Interface(
|
| 101 |
+
fn=classify_watermark,
|
| 102 |
+
inputs=gr.Image(type="numpy"),
|
| 103 |
+
outputs=gr.Label(num_top_classes=2, label="Watermark Detection"),
|
| 104 |
+
title="Watermark-Detection-SigLIP2",
|
| 105 |
+
description="Upload an image to detect whether it contains a watermark."
|
| 106 |
+
)
|
| 107 |
+
|
| 108 |
+
if __name__ == "__main__":
|
| 109 |
+
iface.launch()
|
| 110 |
+
```
|
| 111 |
+
|
| 112 |
+
---
|
| 113 |
+
|
| 114 |
+
## **Demo Inference**
|
| 115 |
+
|
| 116 |
+
> [!Warning]
|
| 117 |
+
> Watermark
|
| 118 |
+
|
| 119 |
+
<table>
|
| 120 |
+
<tr>
|
| 121 |
+
<td><img src="https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/sm062kFE7QJiLisTTjNwv.png" width="300"/></td>
|
| 122 |
+
<td><img src="https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/UFymm_tzVRmov6vn_cElE.png" width="300"/></td>
|
| 123 |
+
<td><img src="https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/bPzPAK-Mib8nFhHCkjD2B.png" width="300"/></td>
|
| 124 |
+
</tr>
|
| 125 |
+
<tr>
|
| 126 |
+
<td><img src="https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/4fP8SBIYofKEeDBU0klQ2.png" width="300"/></td>
|
| 127 |
+
<td><img src="https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/wD5M4YgyQGk9-QLFjMcn9.png" width="300"/></td>
|
| 128 |
+
<td><img src="https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/yg0q88-0S4k4FUS4-qGNw.png" width="300"/></td>
|
| 129 |
+
</tr>
|
| 130 |
+
<tr>
|
| 131 |
+
<td><img src="https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/WhRkeYw8-wIgldpaz0E4m.png" width="300"/></td>
|
| 132 |
+
<td><img src="https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/Uhb1zBxQV_5CWLoyTAMmD.png" width="300"/></td>
|
| 133 |
+
<td><img src="https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/7hnLD2b0f7B7edwgx_eOR.png" width="300"/></td>
|
| 134 |
+
</tr>
|
| 135 |
+
</table>
|
| 136 |
+
|
| 137 |
+
> [!Warning]
|
| 138 |
+
> No Watermark
|
| 139 |
+
|
| 140 |
+
<table>
|
| 141 |
+
<tr>
|
| 142 |
+
<td><img src="https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/edyFBIETs3Dosn1edpGZ8.png" width="300"/></td>
|
| 143 |
+
<td><img src="https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/3bRMcr2r0k00mMkthbYDW.png" width="300"/></td>
|
| 144 |
+
<td><img src="https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/eeMLQEg4r89f9owe8jSij.png" width="300"/></td>
|
| 145 |
+
</tr>
|
| 146 |
+
<tr>
|
| 147 |
+
<td><img src="https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/45jk4dvZk1wT3L7cprqql.png" width="300"/></td>
|
| 148 |
+
<td><img src="https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/mrkm0JXXgSQVXi0_d7EKH.png" width="300"/></td>
|
| 149 |
+
<td><img src="https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/f_5R7Inb8I-32hWJchkgj.png" width="300"/></td>
|
| 150 |
+
</tr>
|
| 151 |
+
<tr>
|
| 152 |
+
<td><img src="https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/qIUTSy8SuJEsRkYGd0L5d.png" width="300"/></td>
|
| 153 |
+
<td><img src="https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/DnlNo9lM4mBNUjlexKLVa.png" width="300"/></td>
|
| 154 |
+
<td><img src="https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/bs4oyaapW8mi0lizOqWSf.png" width="300"/></td>
|
| 155 |
+
</tr>
|
| 156 |
+
</table>
|
| 157 |
+
|
| 158 |
+
---
|
| 159 |
+
|
| 160 |
+
## **Intended Use**
|
| 161 |
+
|
| 162 |
+
**Watermark-Detection-SigLIP2** is useful in scenarios such as:
|
| 163 |
+
|
| 164 |
+
- **Content Moderation** – Automatically detect watermarked content on image sharing platforms.
|
| 165 |
+
- **Dataset Cleaning** – Filter out watermarked images from training datasets.
|
| 166 |
+
- **Copyright Enforcement** – Monitor and flag usage of watermarked media.
|
| 167 |
+
- **Digital Forensics** – Support analysis of tampered or protected media assets.
|
| 168 |
+
|
| 169 |
+
|
| 170 |
+
|
checkpoint-1424/config.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"SiglipForImageClassification"
|
| 4 |
+
],
|
| 5 |
+
"id2label": {
|
| 6 |
+
"0": "No Watermark",
|
| 7 |
+
"1": "Watermark"
|
| 8 |
+
},
|
| 9 |
+
"initializer_factor": 1.0,
|
| 10 |
+
"label2id": {
|
| 11 |
+
"No Watermark": 0,
|
| 12 |
+
"Watermark": 1
|
| 13 |
+
},
|
| 14 |
+
"model_type": "siglip",
|
| 15 |
+
"problem_type": "single_label_classification",
|
| 16 |
+
"text_config": {
|
| 17 |
+
"attention_dropout": 0.0,
|
| 18 |
+
"hidden_act": "gelu_pytorch_tanh",
|
| 19 |
+
"hidden_size": 768,
|
| 20 |
+
"intermediate_size": 3072,
|
| 21 |
+
"layer_norm_eps": 1e-06,
|
| 22 |
+
"max_position_embeddings": 64,
|
| 23 |
+
"model_type": "siglip_text_model",
|
| 24 |
+
"num_attention_heads": 12,
|
| 25 |
+
"num_hidden_layers": 12,
|
| 26 |
+
"projection_size": 768,
|
| 27 |
+
"torch_dtype": "float32",
|
| 28 |
+
"vocab_size": 256000
|
| 29 |
+
},
|
| 30 |
+
"torch_dtype": "float32",
|
| 31 |
+
"transformers_version": "4.50.0",
|
| 32 |
+
"vision_config": {
|
| 33 |
+
"attention_dropout": 0.0,
|
| 34 |
+
"hidden_act": "gelu_pytorch_tanh",
|
| 35 |
+
"hidden_size": 768,
|
| 36 |
+
"image_size": 224,
|
| 37 |
+
"intermediate_size": 3072,
|
| 38 |
+
"layer_norm_eps": 1e-06,
|
| 39 |
+
"model_type": "siglip_vision_model",
|
| 40 |
+
"num_attention_heads": 12,
|
| 41 |
+
"num_channels": 3,
|
| 42 |
+
"num_hidden_layers": 12,
|
| 43 |
+
"patch_size": 16,
|
| 44 |
+
"torch_dtype": "float32"
|
| 45 |
+
}
|
| 46 |
+
}
|
checkpoint-1424/preprocessor_config.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"do_convert_rgb": null,
|
| 3 |
+
"do_normalize": true,
|
| 4 |
+
"do_rescale": true,
|
| 5 |
+
"do_resize": true,
|
| 6 |
+
"image_mean": [
|
| 7 |
+
0.5,
|
| 8 |
+
0.5,
|
| 9 |
+
0.5
|
| 10 |
+
],
|
| 11 |
+
"image_processor_type": "SiglipImageProcessor",
|
| 12 |
+
"image_std": [
|
| 13 |
+
0.5,
|
| 14 |
+
0.5,
|
| 15 |
+
0.5
|
| 16 |
+
],
|
| 17 |
+
"processor_class": "SiglipProcessor",
|
| 18 |
+
"resample": 2,
|
| 19 |
+
"rescale_factor": 0.00392156862745098,
|
| 20 |
+
"size": {
|
| 21 |
+
"height": 224,
|
| 22 |
+
"width": 224
|
| 23 |
+
}
|
| 24 |
+
}
|
checkpoint-1424/rng_state.pth
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:13b2b1a200d366a090241026c516010359252c9ecfd83705f10861a52b5c39e9
|
| 3 |
+
size 14244
|
checkpoint-1424/scheduler.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:847c98626d39d680c32b284d7139041edc61ef79d4947f1060da6b500567b4aa
|
| 3 |
+
size 1064
|
checkpoint-1424/trainer_state.json
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"best_global_step": 1424,
|
| 3 |
+
"best_metric": 0.23910000920295715,
|
| 4 |
+
"best_model_checkpoint": "siglip2-finetune-full/checkpoint-1424",
|
| 5 |
+
"epoch": 2.0,
|
| 6 |
+
"eval_steps": 500,
|
| 7 |
+
"global_step": 1424,
|
| 8 |
+
"is_hyper_param_search": false,
|
| 9 |
+
"is_local_process_zero": true,
|
| 10 |
+
"is_world_process_zero": true,
|
| 11 |
+
"log_history": [
|
| 12 |
+
{
|
| 13 |
+
"epoch": 0.702247191011236,
|
| 14 |
+
"grad_norm": 16.442720413208008,
|
| 15 |
+
"learning_rate": 1.3449781659388646e-06,
|
| 16 |
+
"loss": 0.6162,
|
| 17 |
+
"step": 500
|
| 18 |
+
},
|
| 19 |
+
{
|
| 20 |
+
"epoch": 1.0,
|
| 21 |
+
"eval_accuracy": 0.9363852034091907,
|
| 22 |
+
"eval_loss": 0.2713288962841034,
|
| 23 |
+
"eval_model_preparation_time": 0.0023,
|
| 24 |
+
"eval_runtime": 335.7294,
|
| 25 |
+
"eval_samples_per_second": 67.799,
|
| 26 |
+
"eval_steps_per_second": 8.477,
|
| 27 |
+
"step": 712
|
| 28 |
+
},
|
| 29 |
+
{
|
| 30 |
+
"epoch": 1.404494382022472,
|
| 31 |
+
"grad_norm": 16.62710189819336,
|
| 32 |
+
"learning_rate": 6.171761280931587e-07,
|
| 33 |
+
"loss": 0.519,
|
| 34 |
+
"step": 1000
|
| 35 |
+
},
|
| 36 |
+
{
|
| 37 |
+
"epoch": 2.0,
|
| 38 |
+
"eval_accuracy": 0.9426676039012389,
|
| 39 |
+
"eval_loss": 0.23910000920295715,
|
| 40 |
+
"eval_model_preparation_time": 0.0023,
|
| 41 |
+
"eval_runtime": 338.2117,
|
| 42 |
+
"eval_samples_per_second": 67.301,
|
| 43 |
+
"eval_steps_per_second": 8.415,
|
| 44 |
+
"step": 1424
|
| 45 |
+
}
|
| 46 |
+
],
|
| 47 |
+
"logging_steps": 500,
|
| 48 |
+
"max_steps": 1424,
|
| 49 |
+
"num_input_tokens_seen": 0,
|
| 50 |
+
"num_train_epochs": 2,
|
| 51 |
+
"save_steps": 500,
|
| 52 |
+
"stateful_callbacks": {
|
| 53 |
+
"TrainerControl": {
|
| 54 |
+
"args": {
|
| 55 |
+
"should_epoch_stop": false,
|
| 56 |
+
"should_evaluate": false,
|
| 57 |
+
"should_log": false,
|
| 58 |
+
"should_save": true,
|
| 59 |
+
"should_training_stop": true
|
| 60 |
+
},
|
| 61 |
+
"attributes": {}
|
| 62 |
+
}
|
| 63 |
+
},
|
| 64 |
+
"total_flos": 3.8128851917694075e+18,
|
| 65 |
+
"train_batch_size": 32,
|
| 66 |
+
"trial_name": null,
|
| 67 |
+
"trial_params": null
|
| 68 |
+
}
|
checkpoint-1424/training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4138dcb234dcef0352a6fbae254152fc6e7544045ab1dbc0e451ec4366da1634
|
| 3 |
+
size 5304
|
checkpoint-712/config.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"SiglipForImageClassification"
|
| 4 |
+
],
|
| 5 |
+
"id2label": {
|
| 6 |
+
"0": "No Watermark",
|
| 7 |
+
"1": "Watermark"
|
| 8 |
+
},
|
| 9 |
+
"initializer_factor": 1.0,
|
| 10 |
+
"label2id": {
|
| 11 |
+
"No Watermark": 0,
|
| 12 |
+
"Watermark": 1
|
| 13 |
+
},
|
| 14 |
+
"model_type": "siglip",
|
| 15 |
+
"problem_type": "single_label_classification",
|
| 16 |
+
"text_config": {
|
| 17 |
+
"attention_dropout": 0.0,
|
| 18 |
+
"hidden_act": "gelu_pytorch_tanh",
|
| 19 |
+
"hidden_size": 768,
|
| 20 |
+
"intermediate_size": 3072,
|
| 21 |
+
"layer_norm_eps": 1e-06,
|
| 22 |
+
"max_position_embeddings": 64,
|
| 23 |
+
"model_type": "siglip_text_model",
|
| 24 |
+
"num_attention_heads": 12,
|
| 25 |
+
"num_hidden_layers": 12,
|
| 26 |
+
"projection_size": 768,
|
| 27 |
+
"torch_dtype": "float32",
|
| 28 |
+
"vocab_size": 256000
|
| 29 |
+
},
|
| 30 |
+
"torch_dtype": "float32",
|
| 31 |
+
"transformers_version": "4.50.0",
|
| 32 |
+
"vision_config": {
|
| 33 |
+
"attention_dropout": 0.0,
|
| 34 |
+
"hidden_act": "gelu_pytorch_tanh",
|
| 35 |
+
"hidden_size": 768,
|
| 36 |
+
"image_size": 224,
|
| 37 |
+
"intermediate_size": 3072,
|
| 38 |
+
"layer_norm_eps": 1e-06,
|
| 39 |
+
"model_type": "siglip_vision_model",
|
| 40 |
+
"num_attention_heads": 12,
|
| 41 |
+
"num_channels": 3,
|
| 42 |
+
"num_hidden_layers": 12,
|
| 43 |
+
"patch_size": 16,
|
| 44 |
+
"torch_dtype": "float32"
|
| 45 |
+
}
|
| 46 |
+
}
|
checkpoint-712/preprocessor_config.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"do_convert_rgb": null,
|
| 3 |
+
"do_normalize": true,
|
| 4 |
+
"do_rescale": true,
|
| 5 |
+
"do_resize": true,
|
| 6 |
+
"image_mean": [
|
| 7 |
+
0.5,
|
| 8 |
+
0.5,
|
| 9 |
+
0.5
|
| 10 |
+
],
|
| 11 |
+
"image_processor_type": "SiglipImageProcessor",
|
| 12 |
+
"image_std": [
|
| 13 |
+
0.5,
|
| 14 |
+
0.5,
|
| 15 |
+
0.5
|
| 16 |
+
],
|
| 17 |
+
"processor_class": "SiglipProcessor",
|
| 18 |
+
"resample": 2,
|
| 19 |
+
"rescale_factor": 0.00392156862745098,
|
| 20 |
+
"size": {
|
| 21 |
+
"height": 224,
|
| 22 |
+
"width": 224
|
| 23 |
+
}
|
| 24 |
+
}
|
checkpoint-712/rng_state.pth
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:57ca47b1e99fcaf46bc056bcb92bed3455a48faa74111373f1b003d76595409e
|
| 3 |
+
size 14244
|
checkpoint-712/scheduler.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fa080b4dbab1f138b2cecf9d7402c5cbaaa81390a9edbd3ef8c30ae273047153
|
| 3 |
+
size 1064
|
checkpoint-712/trainer_state.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"best_global_step": 712,
|
| 3 |
+
"best_metric": 0.2713288962841034,
|
| 4 |
+
"best_model_checkpoint": "siglip2-finetune-full/checkpoint-712",
|
| 5 |
+
"epoch": 1.0,
|
| 6 |
+
"eval_steps": 500,
|
| 7 |
+
"global_step": 712,
|
| 8 |
+
"is_hyper_param_search": false,
|
| 9 |
+
"is_local_process_zero": true,
|
| 10 |
+
"is_world_process_zero": true,
|
| 11 |
+
"log_history": [
|
| 12 |
+
{
|
| 13 |
+
"epoch": 0.702247191011236,
|
| 14 |
+
"grad_norm": 16.442720413208008,
|
| 15 |
+
"learning_rate": 1.3449781659388646e-06,
|
| 16 |
+
"loss": 0.6162,
|
| 17 |
+
"step": 500
|
| 18 |
+
},
|
| 19 |
+
{
|
| 20 |
+
"epoch": 1.0,
|
| 21 |
+
"eval_accuracy": 0.9363852034091907,
|
| 22 |
+
"eval_loss": 0.2713288962841034,
|
| 23 |
+
"eval_model_preparation_time": 0.0023,
|
| 24 |
+
"eval_runtime": 335.7294,
|
| 25 |
+
"eval_samples_per_second": 67.799,
|
| 26 |
+
"eval_steps_per_second": 8.477,
|
| 27 |
+
"step": 712
|
| 28 |
+
}
|
| 29 |
+
],
|
| 30 |
+
"logging_steps": 500,
|
| 31 |
+
"max_steps": 1424,
|
| 32 |
+
"num_input_tokens_seen": 0,
|
| 33 |
+
"num_train_epochs": 2,
|
| 34 |
+
"save_steps": 500,
|
| 35 |
+
"stateful_callbacks": {
|
| 36 |
+
"TrainerControl": {
|
| 37 |
+
"args": {
|
| 38 |
+
"should_epoch_stop": false,
|
| 39 |
+
"should_evaluate": false,
|
| 40 |
+
"should_log": false,
|
| 41 |
+
"should_save": true,
|
| 42 |
+
"should_training_stop": false
|
| 43 |
+
},
|
| 44 |
+
"attributes": {}
|
| 45 |
+
}
|
| 46 |
+
},
|
| 47 |
+
"total_flos": 1.9064425958847037e+18,
|
| 48 |
+
"train_batch_size": 32,
|
| 49 |
+
"trial_name": null,
|
| 50 |
+
"trial_params": null
|
| 51 |
+
}
|
checkpoint-712/training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4138dcb234dcef0352a6fbae254152fc6e7544045ab1dbc0e451ec4366da1634
|
| 3 |
+
size 5304
|
config.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"SiglipForImageClassification"
|
| 4 |
+
],
|
| 5 |
+
"id2label": {
|
| 6 |
+
"0": "No Watermark",
|
| 7 |
+
"1": "Watermark"
|
| 8 |
+
},
|
| 9 |
+
"initializer_factor": 1.0,
|
| 10 |
+
"label2id": {
|
| 11 |
+
"No Watermark": 0,
|
| 12 |
+
"Watermark": 1
|
| 13 |
+
},
|
| 14 |
+
"model_type": "siglip",
|
| 15 |
+
"problem_type": "single_label_classification",
|
| 16 |
+
"text_config": {
|
| 17 |
+
"attention_dropout": 0.0,
|
| 18 |
+
"hidden_act": "gelu_pytorch_tanh",
|
| 19 |
+
"hidden_size": 768,
|
| 20 |
+
"intermediate_size": 3072,
|
| 21 |
+
"layer_norm_eps": 1e-06,
|
| 22 |
+
"max_position_embeddings": 64,
|
| 23 |
+
"model_type": "siglip_text_model",
|
| 24 |
+
"num_attention_heads": 12,
|
| 25 |
+
"num_hidden_layers": 12,
|
| 26 |
+
"projection_size": 768,
|
| 27 |
+
"torch_dtype": "float32",
|
| 28 |
+
"vocab_size": 256000
|
| 29 |
+
},
|
| 30 |
+
"torch_dtype": "float32",
|
| 31 |
+
"transformers_version": "4.50.0",
|
| 32 |
+
"vision_config": {
|
| 33 |
+
"attention_dropout": 0.0,
|
| 34 |
+
"hidden_act": "gelu_pytorch_tanh",
|
| 35 |
+
"hidden_size": 768,
|
| 36 |
+
"image_size": 224,
|
| 37 |
+
"intermediate_size": 3072,
|
| 38 |
+
"layer_norm_eps": 1e-06,
|
| 39 |
+
"model_type": "siglip_vision_model",
|
| 40 |
+
"num_attention_heads": 12,
|
| 41 |
+
"num_channels": 3,
|
| 42 |
+
"num_hidden_layers": 12,
|
| 43 |
+
"patch_size": 16,
|
| 44 |
+
"torch_dtype": "float32"
|
| 45 |
+
}
|
| 46 |
+
}
|
preprocessor_config.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"do_convert_rgb": null,
|
| 3 |
+
"do_normalize": true,
|
| 4 |
+
"do_rescale": true,
|
| 5 |
+
"do_resize": true,
|
| 6 |
+
"image_mean": [
|
| 7 |
+
0.5,
|
| 8 |
+
0.5,
|
| 9 |
+
0.5
|
| 10 |
+
],
|
| 11 |
+
"image_processor_type": "SiglipImageProcessor",
|
| 12 |
+
"image_std": [
|
| 13 |
+
0.5,
|
| 14 |
+
0.5,
|
| 15 |
+
0.5
|
| 16 |
+
],
|
| 17 |
+
"processor_class": "SiglipProcessor",
|
| 18 |
+
"resample": 2,
|
| 19 |
+
"rescale_factor": 0.00392156862745098,
|
| 20 |
+
"size": {
|
| 21 |
+
"height": 224,
|
| 22 |
+
"width": 224
|
| 23 |
+
}
|
| 24 |
+
}
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4138dcb234dcef0352a6fbae254152fc6e7544045ab1dbc0e451ec4366da1634
|
| 3 |
+
size 5304
|