v0.9.0

datalab-to/suryav0.9.0Jan 22, 2025by VikParuchuri

AI Summary

A major refactor of the library introducing a new table recognition model and a significantly simplified API.

Key Highlights

  • Complete code refactor for better organization
  • New table recognition model with better colspan/rowspan/header detection
  • Simplified API that operates directly on images without needing bounding boxes

Breaking Changes

  • API has changed; models are now imported and used differently (e.g., `RecognitionPredictor`)

New Features

  • New table recognition model
  • Code refactoring

Full Release Notes

## 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:

```python
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
* Layout improvements by @VikParuchuri in https://github.com/VikParuchuri/surya/pull/267
* New table model; total refactor by @VikParuchuri in https://github.com/VikParuchuri/surya/pull/279
* Add ci workflow by @VikParuchuri in https://github.com/VikParuchuri/surya/pull/284

**Full Changelog**: https://github.com/VikParuchuri/surya/compare/v0.8.3...v0.9.0