Views
No views yet
pip install surya-ocr1from PIL import Image
2from surya.fast_layout import FastLayoutPredictor
3
4predictor = FastLayoutPredictor(checkpoint="hf://datalab-to/surya_layout2")
5layout = predictor([Image.open("page.png")])
6
7for box in layout[0].bboxes:
8 print(box.label, box.bbox, box.position) # region label, [x0,y0,x1,y1], reading-order indexexport FAST_LAYOUT_MODEL_CHECKPOINT="hf://datalab-to/surya_layout2"LICENSE) — the same
license as the surya-ocr-2
model weights.