Metadata-Version: 2.4
Name: manuscript-ocr
Version: 0.1.5
Summary: EAST-based OCR detector API
Home-page: https://github.com/konstantinkozhin/manuscript-ocr
Author: 
Author-email: 
License: MIT
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: torch<2.1,>=2.0.1
Requires-Dist: torchvision<0.16,>=0.15.2
Requires-Dist: torchaudio<2.1,>=2.0.2
Requires-Dist: numpy<2.0,>=1.23
Requires-Dist: opencv-python<6.0,>=4.5
Requires-Dist: Pillow<10.0,>=9.0
Requires-Dist: shapely<3.0,>=2.0
Requires-Dist: numba<0.60,>=0.56
Requires-Dist: tensorboard<3.0,>=2.10
Requires-Dist: gdown<5.0,>=4.4
Requires-Dist: pydantic<2.0,>=1.10
Requires-Dist: scikit-image<1.0,>=0.19
Requires-Dist: torch-optimizer<0.3,>=0.1
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

## Installation

```bash
pip install manuscript-ocr
````

## Usage Example

```python
from PIL import Image
from manuscript.detectors import EASTInfer

# Инициализация
det = EASTInfer(score_thresh=0.9)

# Инфер с визуализацией
page, vis_image = det.infer(r"example\ocr_example_image.jpg", vis=True)

print(page)

# Покажет картинку с наложенными боксами
Image.fromarray(vis_image).show()

# Или сохранить результат на диск:
Image.fromarray(vis_image).save(r"example\ocr_example_image_infer.png")
```

### Результат

Текстовые блоки будут выведены в консоль, например:

```
Page(blocks=[Block(words=[Word(polygon=[(874.1005, 909.1005), (966.8995, 909.1005), (966.8995, 956.8995), (874.1005, 956.8995)]),
                          Word(polygon=[(849.1234, 810.5678), … ])])])
```

А визуализация сохранится в файл `example/ocr_example_image_infer.png`:

![OCR Inference Result](example/ocr_example_image_infer.png)
