Views
No views yet
deepseek-ai/DeepSeek-OCR-2
for Karakalpak-language OCR (Cyrillic script, including the extended glyphs
ӊ, ў, қ, ғ, ҳ, ә). Trained on scanned pages of Karakalpak books.| Model | CER ↓ | WER ↓ | Mean latency (s) |
|---|---|---|---|
| DeepSeek-OCR-2 + LoRA (this model) | 0.0556 | 0.1876 | 36.12 |
| Tesseract 5 (rus) | 0.1930 | 0.6529 | 1.50 |
| DeepSeek-OCR-2 (base, no fine-tune) | 0.4258 | 0.6987 | 17.45 |
| GOT-OCR-2.0 | 1.1720 | 1.0701 | 14.28 |
Note on Tesseract: theruslanguage pack lacks the Karakalpak-specific Cyrillic glyphs, which inflates its error rate — included as a classical non-neural baseline for context.
deepseek_vl_v2 architecture)q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_projno_grad)<image>\nFree OCR. (plain-text targets, no layout/grounding)1import torch, tempfile
2from transformers import AutoModel, AutoTokenizer
3from peft import PeftModel
4
5BASE = "deepseek-ai/DeepSeek-OCR-2"
6ADAPTER = "nickoo004/deepseek-ocr2-karakalpak-lora"
7
8tok = AutoTokenizer.from_pretrained(BASE, trust_remote_code=True)
9model = AutoModel.from_pretrained(
10 BASE, trust_remote_code=True, use_safetensors=True,
11 _attn_implementation="flash_attention_2", torch_dtype=torch.bfloat16,
12).cuda().eval()
13model = PeftModel.from_pretrained(model, ADAPTER).eval()
14
15# OCR a page
16text = model.infer(
17 tok, prompt="<image>\nFree OCR. ",
18 image_file="page.png", output_path="/tmp/out",
19 base_size=1024, image_size=768, crop_mode=True,
20 save_results=False, eval_mode=True,
21)
22print(text)text_label).