Image Classification
Transformers
Safetensors
English
siglip
Formula-Text-Detection
SigLIP2
Image-Classification
Instructions to use prithivMLmods/Formula-Text-Detection with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use prithivMLmods/Formula-Text-Detection with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="prithivMLmods/Formula-Text-Detection") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# Load model directly from transformers import AutoProcessor, AutoModelForImageClassification processor = AutoProcessor.from_pretrained("prithivMLmods/Formula-Text-Detection") model = AutoModelForImageClassification.from_pretrained("prithivMLmods/Formula-Text-Detection", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -19,6 +19,10 @@ tags:
|
|
| 19 |
|
| 20 |
> **Formula-Text-Detection** is a vision-language encoder model fine-tuned from **google/siglip2-base-patch16-224** for **binary image classification**. It is built using the **SiglipForImageClassification** architecture to distinguish between **mathematical formulas** and **natural text** in document or image regions.
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
```py
|
| 23 |
Classification Report:
|
| 24 |
precision recall f1-score support
|
|
@@ -100,6 +104,22 @@ iface = gr.Interface(
|
|
| 100 |
if __name__ == "__main__":
|
| 101 |
iface.launch()
|
| 102 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
|
| 104 |
---
|
| 105 |
|
|
|
|
| 19 |
|
| 20 |
> **Formula-Text-Detection** is a vision-language encoder model fine-tuned from **google/siglip2-base-patch16-224** for **binary image classification**. It is built using the **SiglipForImageClassification** architecture to distinguish between **mathematical formulas** and **natural text** in document or image regions.
|
| 21 |
|
| 22 |
+
> [!Note]
|
| 23 |
+
> Note: This model works best with plain text or formulas using the same font style
|
| 24 |
+
|
| 25 |
+
|
| 26 |
```py
|
| 27 |
Classification Report:
|
| 28 |
precision recall f1-score support
|
|
|
|
| 104 |
if __name__ == "__main__":
|
| 105 |
iface.launch()
|
| 106 |
```
|
| 107 |
+
## **Demo Inference**
|
| 108 |
+
|
| 109 |
+
> [!Important]
|
| 110 |
+
> Text
|
| 111 |
+
|
| 112 |
+
|
| 113 |
+

|
| 114 |
+

|
| 115 |
+

|
| 116 |
+
|
| 117 |
+
> [!Important]
|
| 118 |
+
> Formula
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+

|
| 122 |
+

|
| 123 |
|
| 124 |
---
|
| 125 |
|