Instructions to use scrollprize/ink_detection_pipeline with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use scrollprize/ink_detection_pipeline with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="scrollprize/ink_detection_pipeline", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("scrollprize/ink_detection_pipeline", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
# Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("scrollprize/ink_detection_pipeline", trust_remote_code=True, dtype="auto")Quick Links
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
- 12
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="scrollprize/ink_detection_pipeline", trust_remote_code=True)