Update zero-shot comparison table
#1
by Omi777 - opened
- README.md +4 -2
- scripts/evaluate_zero_shot.py +7 -1
README.md
CHANGED
|
@@ -32,14 +32,16 @@ We evaluate CropVLM against CLIP-based baselines by encoding each crop class nam
|
|
| 32 |
|
| 33 |
| Model | Overall Accuracy (%) | Per-Class Mean +/- Std (%) |
|
| 34 |
|---|---:|---:|
|
| 35 |
-
|
|
| 36 |
-
| AgriCLIP | 4.04 | 4.04 +/- 14.61 |
|
| 37 |
| RemoteCLIP | 42.52 | 42.52 +/- 27.57 |
|
| 38 |
| BioCLIP | 48.33 | 48.34 +/- 34.95 |
|
| 39 |
| BioTrove-CLIP | 51.07 | 51.07 +/- 36.20 |
|
| 40 |
| BioCLIP 2 | 67.74 | 67.74 +/- 31.17 |
|
| 41 |
| OpenAI CLIP ViT-B/32 | 70.24 | 70.24 +/- 28.83 |
|
| 42 |
| **CropVLM** | **72.51** | **72.51 +/- 29.71** |
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
## Installation
|
| 45 |
|
|
|
|
| 32 |
|
| 33 |
| Model | Overall Accuracy (%) | Per-Class Mean +/- Std (%) |
|
| 34 |
|---|---:|---:|
|
| 35 |
+
| AgriCLIP | 3.64 | 3.64 +/- 12.69 |
|
|
|
|
| 36 |
| RemoteCLIP | 42.52 | 42.52 +/- 27.57 |
|
| 37 |
| BioCLIP | 48.33 | 48.34 +/- 34.95 |
|
| 38 |
| BioTrove-CLIP | 51.07 | 51.07 +/- 36.20 |
|
| 39 |
| BioCLIP 2 | 67.74 | 67.74 +/- 31.17 |
|
| 40 |
| OpenAI CLIP ViT-B/32 | 70.24 | 70.24 +/- 28.83 |
|
| 41 |
| **CropVLM** | **72.51** | **72.51 +/- 29.71** |
|
| 42 |
+
| SigLIP 2 | 92.51 | 92.51 +/- 16.61 |
|
| 43 |
+
|
| 44 |
+
SigLIP 2 is reported with fixed 64-token text padding, following the official SigLIP2 preprocessing requirement. AgriCLIP is reported using its official `Agri_Dino_aligner_DPT_CPT.pth` aligned checkpoint; because AgriCLIP is a DINO-to-CLIP alignment pipeline rather than a standard CLIP-style encoder, this result should be interpreted cautiously.
|
| 45 |
|
| 46 |
## Installation
|
| 47 |
|
scripts/evaluate_zero_shot.py
CHANGED
|
@@ -163,7 +163,13 @@ class Siglip2Adapter(Adapter):
|
|
| 163 |
self.model = AutoModel.from_pretrained(self.name).to(device).eval()
|
| 164 |
|
| 165 |
def encode_text(self, prompts: Sequence[str]) -> torch.Tensor:
|
| 166 |
-
inputs = self.processor(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 167 |
with torch.no_grad():
|
| 168 |
if hasattr(self.model, "get_text_features"):
|
| 169 |
features = self.model.get_text_features(**inputs)
|
|
|
|
| 163 |
self.model = AutoModel.from_pretrained(self.name).to(device).eval()
|
| 164 |
|
| 165 |
def encode_text(self, prompts: Sequence[str]) -> torch.Tensor:
|
| 166 |
+
inputs = self.processor(
|
| 167 |
+
text=[prompt.lower() for prompt in prompts],
|
| 168 |
+
padding="max_length",
|
| 169 |
+
max_length=64,
|
| 170 |
+
truncation=True,
|
| 171 |
+
return_tensors="pt",
|
| 172 |
+
).to(self.device)
|
| 173 |
with torch.no_grad():
|
| 174 |
if hasattr(self.model, "get_text_features"):
|
| 175 |
features = self.model.get_text_features(**inputs)
|