This repository contains
layout-fine-tune.ipynb file, Please use this file to fine tune
Surya Layout Model. This model uses modified architecture of Segformer.
1git clone https://github.com/vikp/surya.git
2cd surya
For image pre-processing we can directly import a function and image processor from
surya ocr github repository.
1from PIL import Image
2image = Image.open("path/to/image")
3images = [prepare_image_detection(img=image, processor=load_processor())]
1import torch
2images = torch.stack(images, dim=0).to(model.dtype).to(model.device)
Surya-layout-Model does not have pre-defined loss function, We have to define it according to our dataset and the Requirements.