arslan911/qwen2-vl-ocr
0
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
title: Qwen2-VL-2B-OCR emoji: ๐ colorFrom: blue colorTo: indigo sdk: docker pinned: false ---
Qwen2-VL-2B-OCR
OCR API using Qwen2-VL-2B model for text extraction.
API Endpoints
POST /ocr- Base64 image inputPOST /upload- File uploadPOST /structured- Structured contact extractionGET /health- Health check
Usage
import requests
import base64
with open("image.png", "rb") as f:
img_base64 = base64.b64encode(f.read()).decode()
response = requests.post(
"https://YOUR_SPACE.hf.space/ocr",
json={"image": img_base64}
)
print(response.json()["text"])