Ink detection pipeline using the Grandprize winning model.

Install the relevant packages using the following command:

pip install -U vesuvius transformer timesformer-pytorch
vesuvius.accept_terms --yes

Read ancient text and retrieve 2000 year old letters using this simple code snippet:

import vesuvius
import numpy as np
import matplotlib.pyplot as plt
from vesuvius import Volume
from transformers import pipeline


segment = Volume(20230827161847, normalize=True)

classifier = pipeline(model="scrollprize/ink_detection_pipeline", trust_remote_code=True, tile_size=64, stride=32, scale_factor=16)
prediction = classifier(np.transpose(segment[17:43, 200:5600,1000:4600],(1,2,0)).astype(np.float32)) # prediction shape ~ (512,512)

plt.imshow(prediction)
Downloads last month
15
Safetensors
Model size
38M params
Tensor type
F32
·
Inference Providers NEW
This model is not currently available via any of the supported Inference Providers.
The model cannot be deployed to the HF Inference API: The HF Inference API does not support model that require custom code execution.