Karras48 commited on
Commit
569a1c3
·
verified ·
1 Parent(s): 20e116c

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +77 -0
README.md CHANGED
@@ -1,3 +1,80 @@
1
  ---
 
 
 
2
  license: apache-2.0
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ language:
3
+ - en
4
+ - zh
5
  license: apache-2.0
6
+ library_name: transformers
7
+ tags:
8
+ - ocr
9
+ - multimodal
10
+ - vision-language
11
+ - adversarial ocr
12
+ - grounded ocr
13
+ - qwen3-vl
14
+ base_model:
15
+ - Qwen/Qwen3-VL-8B-Instruct
16
+ pipeline_tag: image-text-to-text
17
  ---
18
+
19
+ # ArmorOCR
20
+
21
+ [![Code](https://img.shields.io/badge/Code-GitHub-black)](https://github.com/ant-research/ArmorOCR)
22
+ [![Paper](https://img.shields.io/badge/Paper-arXiv-blue)](https://arxiv.org/abs/2608.20122)
23
+ [![License](https://img.shields.io/badge/License-Apache--2.0-yellow)](https://www.apache.org/licenses/LICENSE-2.0)
24
+
25
+ **ArmorOCR** is a two-stage framework for **grounded adversarial OCR perception** built on Qwen3-VL-8B-Instruct. It enables single-pass inference on the original image, without any inference-time visual transformations or tool assistance.
26
+
27
+ 📖 For training details, the AdvSpot benchmark, and evaluation scripts, please visit the [GitHub repo](https://github.com/ant-research/ArmorOCR).
28
+
29
+ ## Quickstart
30
+
31
+ ```bash
32
+ pip install transformers==4.57.1 accelerate
33
+ ```
34
+
35
+ ```python
36
+ from transformers import Qwen3VLForConditionalGeneration, AutoProcessor
37
+
38
+ model = Qwen3VLForConditionalGeneration.from_pretrained(
39
+ "inclusionAI/ArmorOCR", dtype="auto", device_map="auto",
40
+ )
41
+ processor = AutoProcessor.from_pretrained("inclusionAI/ArmorOCR")
42
+
43
+ messages = [{
44
+ "role": "user",
45
+ "content": [
46
+ {"type": "image", "image": "path/to/image.png"},
47
+ {"type": "text",
48
+ "text": ("Please identify the text in the image. "
49
+ "Put your reasoning inside <analyze></analyze> "
50
+ "and your final recognized text inside <answer></answer>.")},
51
+ ],
52
+ }]
53
+
54
+ inputs = processor.apply_chat_template(
55
+ messages, tokenize=True, add_generation_prompt=True,
56
+ return_dict=True, return_tensors="pt",
57
+ ).to(model.device)
58
+
59
+ out = model.generate(**inputs, max_new_tokens=256)
60
+ trimmed = [o[len(i):] for i, o in zip(inputs.input_ids, out)]
61
+ print(processor.batch_decode(trimmed, skip_special_tokens=True))
62
+ ```
63
+
64
+ ## License
65
+
66
+ Released under the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). Use is additionally subject to the license and acceptable-use policy of the base model [Qwen/Qwen3-VL-8B-Instruct](https://huggingface.co/Qwen/Qwen3-VL-8B-Instruct).
67
+
68
+ ## Citation
69
+
70
+ ```bibtex
71
+ @misc{cao2026armorocrgroundedadversarialvisual,
72
+ title={ArmorOCR: Grounded Adversarial Visual Perception via Observation-Transferred Self-Distillation},
73
+ author={Linhan Cao and Siyuan Li and Jun Lan and Liangbo He and Guannan Li and Xiaolei Huang and Jun Jia and Shuheng Zhou and Huijia Zhu and Weiqiang Wang and Wei Sun},
74
+ year={2026},
75
+ eprint={2608.20122},
76
+ archivePrefix={arXiv},
77
+ primaryClass={cs.CV},
78
+ url={https://arxiv.org/abs/2608.20122},
79
+ }
80
+ ```