Downloads · 30 days
9
4% of all-time downloads
ketanmore/surya-ocr-arabic-segment
surya-ocr-arabic-segment is a machine learning model from ketanmore. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
This repository contains the surya-ocr-arabic-segment model, which is based on a modified SegFormer architecture. The model was fine-tuned for document segmentation tasks.
Downloads · 30 days
9
4% of all-time downloads
All-time downloads
214
Public
Parameters
30M
120 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors120 MB · 100%
From the Hugging Face model README
This repository contains the surya-ocr-arabic-segment model, which is based on a modified SegFormer architecture. The model was fine-tuned for document segmentation tasks.
To use the SegformerForRegressionMask class, you need to clone the Surya OCR GitHub repository:
git clone https://github.com/vikp/surya.git
cd surya
git checkout f7c6c04
You can install the required dependencies using the following command:
pip install -r requirements.txt
You can load and use the surya-ocr-arabic-segment model as follows:
#we are importing `SegformerForRegressionMask` from the folder of surya OCR repo.
from surya.surya.model.detection.segformer import SegformerForRegressionMask
import torch
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model = SegformerForRegressionMask.from_pretrained("ketanmore/surya-ocr-arabic-segment", torch_dtype=torch.float32).to(device)