Update README.md
Browse files
README.md
CHANGED
|
@@ -4,35 +4,168 @@ tags:
|
|
| 4 |
- spec-vision
|
| 5 |
- vision-language-model
|
| 6 |
- transformers
|
| 7 |
-
license:
|
| 8 |
---
|
| 9 |
|
| 10 |
-
#
|
| 11 |
|
| 12 |
-
|
| 13 |
|
| 14 |
-
|
| 15 |
|
| 16 |
-
|
| 17 |
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
```python
|
| 21 |
-
from transformers import
|
|
|
|
|
|
|
| 22 |
|
| 23 |
# Load the model and processor
|
| 24 |
-
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
# Process inputs
|
| 28 |
inputs = processor(images=image, text=text, return_tensors="pt")
|
| 29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
```
|
| 31 |
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
|
| 34 |
-
|
| 35 |
|
| 36 |
-
|
| 37 |
|
| 38 |
-
|
|
|
|
|
|
|
|
|
| 4 |
- spec-vision
|
| 5 |
- vision-language-model
|
| 6 |
- transformers
|
| 7 |
+
license: mit
|
| 8 |
---
|
| 9 |
|
| 10 |
+
# Model Summary
|
| 11 |
|
| 12 |
+
Spec-Vision-V1 is a lightweight, state-of-the-art open multimodal model built on datasets that include synthetic data and filtered publicly available sources, with a focus on high-quality, reasoning-dense data in both text and vision. The model belongs to the SpecVision family and supports a 128K context length (in tokens). It has undergone a rigorous enhancement process, incorporating supervised fine-tuning and direct preference optimization to ensure precise instruction adherence and robust safety measures.
|
| 13 |
|
| 14 |
+
# π Model Overview
|
| 15 |
|
| 16 |
+
**Spec-Vision-V1** is built for **deep integration of visual and textual data**, enabling it to understand and process images in combination with natural language. The model has been trained on a diverse dataset containing images with associated captions, descriptions, and contextual information.
|
| 17 |
|
| 18 |
+
### β¨ Key Features
|
| 19 |
+
|
| 20 |
+
- **πΌοΈ Multimodal Processing**: Seamlessly combines image and text inputs.
|
| 21 |
+
- **β‘ Transformer-Based Architecture**: High efficiency in vision-language understanding.
|
| 22 |
+
- **π Optimized for VQA & Captioning**: Excels in answering visual questions and generating descriptions.
|
| 23 |
+
- **π₯ Pre-trained Model**: Available for inference and fine-tuning.
|
| 24 |
+
|
| 25 |
+
---
|
| 26 |
+
|
| 27 |
+
## π Installation
|
| 28 |
+
|
| 29 |
+
To use Spec-Vision-V1, install the required dependencies:
|
| 30 |
+
|
| 31 |
+
```bash
|
| 32 |
+
pip install transformers torch torchvision pillow
|
| 33 |
+
```
|
| 34 |
+
|
| 35 |
+
---
|
| 36 |
+
|
| 37 |
+
## π₯ Usage
|
| 38 |
+
|
| 39 |
+
### Load the Model
|
| 40 |
|
| 41 |
```python
|
| 42 |
+
from transformers import AutoModelForCausalLM, AutoProcessor
|
| 43 |
+
from PIL import Image
|
| 44 |
+
import torch
|
| 45 |
|
| 46 |
# Load the model and processor
|
| 47 |
+
model_name = "Spec-Vision-V1"
|
| 48 |
+
model = AutoModelForCausalLM.from_pretrained(model_name)
|
| 49 |
+
processor = AutoProcessor.from_pretrained(model_name)
|
| 50 |
+
|
| 51 |
+
# Load an example image
|
| 52 |
+
image = Image.open("example.jpg")
|
| 53 |
+
|
| 54 |
+
# Input text prompt
|
| 55 |
+
text = "Describe the image in detail."
|
| 56 |
|
| 57 |
# Process inputs
|
| 58 |
inputs = processor(images=image, text=text, return_tensors="pt")
|
| 59 |
+
|
| 60 |
+
# Generate output
|
| 61 |
+
with torch.no_grad():
|
| 62 |
+
outputs = model(**inputs)
|
| 63 |
+
|
| 64 |
+
# Print the generated text
|
| 65 |
+
print(outputs)
|
| 66 |
```
|
| 67 |
|
| 68 |
+
---
|
| 69 |
+
|
| 70 |
+
## π Model Specifications
|
| 71 |
+
|
| 72 |
+
| Attribute | Description |
|
| 73 |
+
|-----------------|----------------------------------------------|
|
| 74 |
+
| **Model Name** | Spec-Vision-V1 |
|
| 75 |
+
| **Architecture** | Transformer-based Vision-Language Model |
|
| 76 |
+
| **Pretrained** | β
Yes |
|
| 77 |
+
| **Dataset** | Trained on diverse image-text pairs |
|
| 78 |
+
| **Framework** | PyTorch & Hugging Face Transformers |
|
| 79 |
+
|
| 80 |
+
---
|
| 81 |
+
|
| 82 |
+
## π― Applications
|
| 83 |
+
|
| 84 |
+
| Task | Description |
|
| 85 |
+
|--------------------------|--------------------------------------------------------------|
|
| 86 |
+
| **πΌοΈ Image Captioning** | Generates detailed descriptions for input images. |
|
| 87 |
+
| **π§ Visual Question Answering** | Answers questions about images. |
|
| 88 |
+
| **π Image-Text Matching** | Determines the relevance of an image to a given text. |
|
| 89 |
+
| **π Scene Understanding** | Extracts insights from complex visual data. |
|
| 90 |
+
|
| 91 |
+
---
|
| 92 |
+
|
| 93 |
+
## BLINK Benchmark
|
| 94 |
+
|
| 95 |
+
A benchmark with 14 visual tasks that humans can solve very quickly but are still hard for current multimodal LLMs.
|
| 96 |
+
|
| 97 |
+
| Benchmark | Spec-Vision-V1 | LlaVA-Interleave-Qwen-7B | InternVL-2-4B | InternVL-2-8B | Gemini-1.5-Flash | GPT-4o-mini | Claude-3.5-Sonnet | Gemini-1.5-Pro | GPT-4o |
|
| 98 |
+
|--------------------------|--------------|--------------------------|---------------|---------------|------------------|-------------|-------------------|----------------|--------|
|
| 99 |
+
| Art Style | 87.2 | 62.4 | 55.6 | 52.1 | 64.1 | 70.1 | 59.8 | 70.9 | 73.3 |
|
| 100 |
+
| Counting | 54.2 | 56.7 | 54.2 | 66.7 | 51.7 | 55.0 | 59.2 | 65.0 | 65.0 |
|
| 101 |
+
| Forensic Detection | 92.4 | 31.1 | 40.9 | 34.1 | 54.5 | 38.6 | 67.4 | 60.6 | 75.8 |
|
| 102 |
+
| Functional Correspondence | 29.2 | 34.6 | 24.6 | 24.6 | 33.1 | 26.9 | 33.8 | 31.5 | 43.8 |
|
| 103 |
+
| IQ Test | 25.3 | 26.7 | 26.0 | 30.7 | 25.3 | 29.3 | 26.0 | 34.0 | 19.3 |
|
| 104 |
+
| Jigsaw | 68.0 | 86.0 | 55.3 | 52.7 | 71.3 | 72.7 | 57.3 | 68.0 | 67.3 |
|
| 105 |
+
| Multi-View Reasoning | 54.1 | 44.4 | 48.9 | 42.9 | 48.9 | 48.1 | 55.6 | 49.6 | 46.6 |
|
| 106 |
+
| Object Localization | 49.2 | 54.9 | 53.3 | 54.1 | 44.3 | 57.4 | 62.3 | 65.6 | 68.0 |
|
| 107 |
+
| Relative Depth | 69.4 | 77.4 | 63.7 | 67.7 | 57.3 | 58.1 | 71.8 | 76.6 | 71.0 |
|
| 108 |
+
| Relative Reflectance | 37.3 | 34.3 | 32.8 | 38.8 | 32.8 | 27.6 | 36.6 | 38.8 | 40.3 |
|
| 109 |
+
| Semantic Correspondence | 36.7 | 31.7 | 31.7 | 22.3 | 32.4 | 31.7 | 45.3 | 48.9 | 54.0 |
|
| 110 |
+
| Spatial Relation | 65.7 | 75.5 | 78.3 | 78.3 | 55.9 | 81.1 | 60.1 | 79.0 | 84.6 |
|
| 111 |
+
| Visual Correspondence | 53.5 | 40.7 | 34.9 | 33.1 | 29.7 | 52.9 | 72.1 | 81.4 | 86.0 |
|
| 112 |
+
| Visual Similarity | 83.0 | 91.9 | 48.1 | 45.2 | 47.4 | 77.8 | 84.4 | 81.5 | 88.1 |
|
| 113 |
+
| **Overall** | **57.0** | **53.1** | **45.9** | **45.4** | **45.8** | **51.9** | **56.5** | **61.0** | **63.2** |
|
| 114 |
+
|
| 115 |
+
---
|
| 116 |
+
|
| 117 |
+
## Video-MME Benchmark
|
| 118 |
+
|
| 119 |
+
A benchmark that comprehensively assesses the capabilities of multimodal LLMs in processing video data, covering a wide range of visual domains, temporal durations, and data modalities.
|
| 120 |
+
|
| 121 |
+
| Benchmark | Spec-Vision-V1 | LlaVA-Interleave-Qwen-7B | InternVL-2-4B | InternVL-2-8B | Gemini-1.5-Flash | GPT-4o-mini | Claude-3.5-Sonnet | Gemini-1.5-Pro | GPT-4o |
|
| 122 |
+
|-------------------------|--------------|--------------------------|---------------|---------------|------------------|-------------|-------------------|----------------|--------|
|
| 123 |
+
| Short (<2min) | 60.8 | 62.3 | 60.7 | 61.7 | 72.2 | 70.1 | 66.3 | 73.3 | 77.7 |
|
| 124 |
+
| Medium (4-15min) | 47.7 | 47.1 | 46.4 | 49.6 | 62.7 | 59.6 | 54.7 | 61.2 | 68.0 |
|
| 125 |
+
| Long (30-60min) | 43.8 | 41.2 | 42.6 | 46.6 | 52.1 | 53.9 | 46.6 | 53.2 | 59.6 |
|
| 126 |
+
| **Overall** | **50.8** | **50.2** | **49.9** | **52.6** | **62.3** | **61.2** | **55.9** | **62.6** | **68.4** |
|
| 127 |
+
|
| 128 |
+
|
| 129 |
+
---
|
| 130 |
+
|
| 131 |
+
## ποΈ Model Training Details
|
| 132 |
+
|
| 133 |
+
| Parameter | Value |
|
| 134 |
+
|----------------------|--------------------------------|
|
| 135 |
+
| **Batch Size** | 16 |
|
| 136 |
+
| **Optimizer** | AdamW |
|
| 137 |
+
| **Learning Rate** | 5e-5 |
|
| 138 |
+
| **Training Steps** | 100k |
|
| 139 |
+
| **Loss Function** | CrossEntropyLoss |
|
| 140 |
+
| **Framework** | PyTorch & Transformers |
|
| 141 |
+
|
| 142 |
+
---
|
| 143 |
+
|
| 144 |
+
## π License
|
| 145 |
+
|
| 146 |
+
**Spec-Vision-V1** is released under the **MIT**.
|
| 147 |
+
|
| 148 |
+
---
|
| 149 |
+
|
| 150 |
+
## π Citation
|
| 151 |
+
|
| 152 |
+
If you use **Spec-Vision-V1** in your research or application, please cite:
|
| 153 |
+
|
| 154 |
+
```bibtex
|
| 155 |
+
@article{SpecVision2025,
|
| 156 |
+
title={Spec-Vision-V1: A Vision-Language Transformer Model},
|
| 157 |
+
author={SVECTOR},
|
| 158 |
+
year={2025},
|
| 159 |
+
journal={SVECTOR Research}
|
| 160 |
+
}
|
| 161 |
+
```
|
| 162 |
+
|
| 163 |
+
---
|
| 164 |
|
| 165 |
+
## π¬ Contact
|
| 166 |
|
| 167 |
+
For support or inquiries, reach out to **SVECTOR**:
|
| 168 |
|
| 169 |
+
- **π Website**: [svector.co.in](https://www.svector.co.in)
|
| 170 |
+
- **π§ Email**: [Research@svector.co.in](Research@svector.co.in)
|
| 171 |
+
- **β¨ GitHub**: [SVECTOR GitHub](https://github.com/SVECTOR-CORPORATION)
|