Downloads · 30 days
6
18% of all-time downloads
Shriyansh11/qwen2-vl-id-card-lora
qwen2-vl-id-card-lora is a image-to-text model from Shriyansh11. Use it when you need a caption or text from an image. It is set up for peft.
This repository contains a Low-Rank Adaptation (LoRA) adapter for Qwen2-VL-2B-Instruct fine-tuned to extract key structural fields from Employee Identification Cards. It was trained and evaluated on programmatically g…
Downloads · 30 days
6
18% of all-time downloads
All-time downloads
34
Public
Repo size
73.9 MB
Likes
0
Public
Click a slice to open those files.
.safetensors73.9 MB · 100%
From the Hugging Face model README
This repository contains a Low-Rank Adaptation (LoRA) adapter for Qwen2-VL-2B-Instruct fine-tuned to extract key structural fields from Employee Identification Cards. It was trained and evaluated on programmatically generated synthetic cards to ensure data privacy (PII compliance) and robustness against scanning distortions.
APEX ENTERPRISES)STEVEN RODRIGUEZ)NEX-5239-Y)Project Manager)2000-11-19)2035-01-25)The model was evaluated on a dedicated, completely unseen Test Set of 50 synthetic ID cards across four distinct environmental noise scenarios (Clean, Gaussian Blur, 10-degree Tilt/Rotation, and Low Light).
Below are the actual measured results comparing the pre-trained Base Model against the Fine-Tuned Model:
| Scenario | Base Model CER | Fine-Tuned (LoRA) CER | Base Field Exact Match | Fine-Tuned (LoRA) Exact Match |
|---|---|---|---|---|
| Clean Set | 82.80% | 0.00% | 92.00% | 100.00% |
| Blurry (Gaussian) | 37.29% | 7.41% | 35.00% | 51.00% |
| Rotated (10°) | 78.48% | 0.00% | 100.00% | 100.00% |
| Low Light (0.25x) | 79.26% | 0.00% | 96.00% | 100.00% |
paged_adamw_8bit (memory pages optimization)Rank (r): 16Alpha: 32Dropout: 0.05Target Modules: ["q_proj", "v_proj", "k_proj", "o_proj", "gate_proj", "up_proj", "down_proj"]You can load this model along with its adapter using the following snippet:
import torch
from transformers import Qwen2VLForConditionalGeneration, AutoProcessor
from peft import PeftModel
model_id = "Qwen/Qwen2-VL-2B-Instruct"
adapter_id = "YOUR_HF_USERNAME/qwen2-vl-id-card-lora" # Replace with your repo identifier
# Load processor
processor = AutoProcessor.from_pretrained(model_id)
# Load base model (quantized or full precision)
model = Qwen2VLForConditionalGeneration.from_pretrained(
model_id,
torch_dtype=torch.float16,
device_map="auto"
)
# Load LoRA adapter
model = PeftModel.from_pretrained(model, adapter_id)