Bina-0.2-Rizeh / QUICKSTART.md
Reza2kn's picture
Complete self-contained Bina 0.2 Rizeh release and quick start
2af6ae7 verified
|
Raw
History Blame Contribute Delete
1.77 kB
# Bina 0.2 Rizeh: quick start / راه‌اندازی سریع
This repository includes both the Persian recognizer and the PP-OCRv6 Medium detector, so the commands below do not download model weights at runtime.
این مخزن هم مدل تشخیص متن فارسی و هم آشکارساز PP-OCRv6 Medium را دارد؛ بنابراین هنگام اجرا وزن دیگری دانلود نمی‌شود.
## Install / نصب
```bash
git lfs install
git clone https://huggingface.co/Reza2kn/Bina-0.2-Rizeh
cd Bina-0.2-Rizeh
python -m pip install "paddlepaddle>=3.2,<4" "paddleocr>=3.3,<4"
```
The command above installs CPU PaddlePaddle. For NVIDIA GPUs, install the PaddlePaddle GPU wheel matching your CUDA version first, then install `paddleocr>=3.3,<4`.
دستور بالا نسخه CPU را نصب می‌کند. برای کارت NVIDIA ابتدا نسخه GPU سازگار با CUDA خود را نصب کنید و سپس PaddleOCR را نصب کنید.
## Full page / صفحه کامل
```bash
python bina_page_ocr.py page.jpg --device cpu --output result.json
# NVIDIA example:
python bina_page_ocr.py page.jpg --device gpu:0 --output result.json
```
Images and PDFs are accepted. Output is UTF-8 JSON containing page text, logical-order Persian lines, confidence scores, and boxes.
## Line crops / برش خط
```bash
python bina_text_recognition.py line.jpg --device cpu
```
Python:
```python
from bina_text_recognition import BinaTextRecognition
model = BinaTextRecognition(device="cpu")
for row in model.predict("line.jpg"):
print(row["text"], row["score"])
```
## Paths / مسیرها
- Recognizer: `inference/`
- Bundled detector: `detector/`
- Best training checkpoint: `checkpoint/`
- Exact benchmark evidence: `benchmark/`