Skip to content

Releases: VikParuchuri/surya

Refactor surya; new table recognition model

22 Jan 18:45
bdda488
Compare
Choose a tag to compare

Refactor

This is a complete refactor of surya - the code is now cleaner and better organized. Models are now imported and used differently, here is an example for OCR:

from PIL import Image
from surya.recognition import RecognitionPredictor
from surya.detection import DetectionPredictor

image = Image.open(IMAGE_PATH)
langs = ["en"] # Replace with your languages or pass None (recommended to use None)
recognition_predictor = RecognitionPredictor()
detection_predictor = DetectionPredictor()

predictions = recognition_predictor([image], [langs], detection_predictor)

See the README for how to use other models.

Table recognition

There is a new table recognition model which detects colspans/rowspans better, along with header cells. It also isn't as complex to use, since it operates on just the images versus the images and bboxes.

What's Changed

Full Changelog: v0.8.3...v0.9.0

Pin pypdfium2

01 Jan 03:10
fc07060
Compare
Choose a tag to compare

Pin pypdfium2 version - newest version can cause issues.

New layout model

30 Dec 17:12
ac03917
Compare
Choose a tag to compare

Layout model is twice as fast and more accurate.

What's Changed

Full Changelog: v0.8.1...v0.8.2

Add bad OCR detection model

19 Dec 17:22
0a82cc7
Compare
Choose a tag to compare
  • Add a model to detect bad OCR text
  • Add top_k predictions to layout
  • Add in test suite

What's Changed

New Contributors

Full Changelog: v0.8.0...v0.8.1

Surya Bugfixes and Improvements to `pdftext`

12 Dec 17:04
b46d5ce
Compare
Choose a tag to compare

Update to the latest pdftext release, incorporating heuristic-based segmentation for enhanced performance and accuracy.

Full Changelog: v0.7.0...v0.8.0

New layout model

27 Nov 17:36
30ce562
Compare
Choose a tag to compare
  • New layout model that detects more block types, includes ordering, and performs better
  • Remove ordering model
  • Refactor internals to use common model definitions and processors
  • Add flags for easier compilation

What's Changed

Full Changelog: v0.6.13...v0.7.0

Performance Improvements

30 Oct 18:22
a8b34c4
Compare
Choose a tag to compare
  • Don't pass around heatmaps by default
  • Use threadpool vs processpool
  • Optimize fn for postprocessing

Flatten table form fields, overlap postprocessing

28 Oct 23:58
47f2384
Compare
Choose a tag to compare
  • Overlap postprocessing if batch size >1
  • Flatten in form fields with tables

Transformers 4.46, torch 2.5 fixes

25 Oct 15:56
caf3ec5
Compare
Choose a tag to compare
  • Fixes cudnn backend issue with torch 2.5
  • Fixes issue with sdpa and transformers 4.46
  • Flatten form fields into pdf by default for table rec

Threads

23 Oct 17:29
54b6299
Compare
Choose a tag to compare

Threads cause issues on a small % of devices. Although they do give good speedups on most, supporting them seems like a bad idea.