Arabic ocr

From Moshe-ship/mkhlab · View interactive version

Arabic ocr is an AI agent skill from the GitHub repository Moshe-ship/mkhlab. Arabic OCR text extraction from images and documents

How to use this skill

Skill file

التعرف على النص العربي (OCR)

QARI-OCR (الأفضل للعربي)

عبر HuggingFace API

curl -s -X POST "https://api-inference.huggingface.co/models/qari-ai/QARI-OCR-v0.3" \
  -H "Authorization: Bearer $HF_TOKEN" \
  -H "Content-Type: image/png" \
  --data-binary @IMAGE_FILE

Tesseract (محلي — بديل مجاني)

تثبيت

# macOS
brew install tesseract tesseract-lang

# التأكد من دعم العربي
tesseract --list-langs | grep ara

استخراج النص

tesseract IMAGE_FILE output -l ara
cat output.txt

عربي + إنجليزي معا

tesseract IMAGE_FILE output -l ara+eng

تحسين الدقة

# تحسين الصورة أولا
magick IMAGE_FILE -resize 300% -sharpen 0x1 -threshold 50% improved.png
tesseract improved.png output -l ara --psm 6

متى تستخدم

أوضاع PSM (Page Segmentation Modes)

| الوضع | الاستخدام |

|-------|-----------|

| --psm 3 | تلقائي (افتراضي) |

| --psm 6 | كتلة نص واحدة (الأفضل للمستندات) |

| --psm 7 | سطر واحد |

| --psm 8 | كلمة واحدة |

| --psm 13 | نص خام بدون OSD |

القواعد

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.