Skip to content
ModelListedExternal
Download

Tibetan Page Orientation Classifier

Predict whether a tibetan manuscript page image is upright (nonflipped) or upside-down (flipped, 180°).

KindOtherBase modelfacebook/dinov3-vits16-pretrain-lvd1689mVersionRevision 12ef840Bgrade

Model source

Kind
Other
File size
82.7 MB
Base model
facebook/dinov3-vits16-pretrain-lvd1689m
Version
vRevision 12ef840
Updated
Sep 17, 2026
Downloads
25
Source
Hugging Face

Source description

Tibetan page orientation classifier (DINOv3 ViT-S)

Predict whether a tibetan manuscript page image is upright (non_flipped) or upside-down (flipped, 180°).

Fine-tuned DINOv3 ViT-S.

Dataset (HF): BDRC/tibetan-page-orientation-classifier-dataset
Experiment: dinov3_binary_flip_center_cropped
Checkpoint: final_model.pt (best validation macro-F1 across stages A + B + C)

Preprocessing (inference)

SplitMode
traincenter_crop
valcenter_crop
testcenter_crop

Use the same mode as training before the DINO image processor (size 448).

Test metrics (n=854)

MetricValue
Accuracy100.0%
Macro F11.000
AUC-ROC1.000
Loss0.1237

Training config

SettingValue
StagesA + B + C
Epochs A / B5 / 10
LR head A0.0005
LR backbone B5e-06
LR head B5e-05
Unfreeze blocks B4
Schedulercosine_warmup
Class weightsnone
Label smoothing0.05

Training history

Training curves

Per-epoch metrics: training_history.json and results.json → history.

Files

FileDescription
final_model.ptWeights + idx_to_label + test metrics
results.jsonFull training config, history, report
training_history.jsonStage A/B epoch logs
confusion_matrix.jsonMachine-readable CM
confusion_matrix.pngPlot
training_history.pngLoss / F1 curves
model_card.jsonSummary metadata
config.yamlTraining hyperparameters (copy)
inference_classifier.pyCLI inference on image paths

Load weights

import torch
ckpt = torch.load("final_model.pt", map_location="cpu", weights_only=False)
print(ckpt["test_metrics"])
print(ckpt["idx_to_label"])

Inference

Use the same preprocessing as training (center_crop, size 448). The bundled script reads defaults from model_card.json when flags are omitted.

pip install -r requirements-inference.txt
python inference_classifier.py --checkpoint final_model.pt --image page.jpg

Explicit flags (recommended for reproducibility):

python inference_classifier.py \
  --checkpoint final_model.pt \
  --image page.jpg \
  --preprocess center_crop \
  --preprocess-size 448

Classes: non_flipped = upright page; flipped = upside-down (180° rotation).

Citation

@misc{bdrcpageorientationmodel,
  title  = {Tibetan Page Orientation Classifier (DINOv3)},
  author = {Buddhist Digital Resource Center and OpenPecha},
  year   = {2026},
  url    = {https://huggingface.co/BDRC/tibetan-page-orieantation-classifier},
  dataset = {https://hunggingface.co/BDRC/tibetan-page-orientation-classifier-dataset},
  experiment = {center-cropped}
  note   = {Trained on BDRC manuscript images}
}

License

Model weights and inference code: Apache License 2.0.

Acknowledgements

All images are provided by the Buddhist Digital Resource Center (BDRC). This dataset was developed by Dharmaduta from specifications provided by BDRC for the project "The BDRC Etext Corpus", with funding from the Khyentse Foundation. Buddhist Digital Resource Center (BDRC). Developed by Dharmaduta / OpenPecha.

Sources

1 source
Hugging FacePrimaryVersion 12ef840da22051c6ee5aa59a19fe916f704d3cef
huggingface.co/BDRC/tibetan-page-orientation-classifier/tree/12ef840da22051c6ee5aa59a19fe916f704d3cef

Verified Sep 2

Model artifacts

1 artifact

final_model.pt

pt · 82.7 MB · SHA-256 1f2cec71b845…4134 · Hugging Face

Download file

Source excerpts

2 excerpts

--- language: - bo tags: - image-classification - tibetan - page-orientation - dinov3 library_name: transformers pipeline_tag: image-classification base_model: facebook/dinov3-vits16-pretrain-lvd1689m datasets: - BDRC/tibetan-page-orientation-classifier-dataset metrics: - f1 - accuracy - auc license: apache-2.0 --- # Tibetan page orientation classifier (DINOv3 ViT-S) Predict whether a tibetan manuscript page image is **upright** (`non_flipped`) or **upside-down** (`flipped`, 180°). Fine-tuned [DINOv3 ViT-S](https://huggingface.co/facebook/dinov3-vits16-pretrain-lvd1689m). **Dataset (HF):** [BDRC/tibetan-page-orientation-classifier-dataset](https://huggingface.co/datasets/BDRC/tibetan-page-orientation-classifier-dataset) **Experiment:** `dinov3_binary_flip_center_cropped` **Checkpoint:** `final_model.pt` (best validation macro-F1 across stages A + B + C) ## Preprocessing (inference) | Split | Mode | |-------|------| | train | `center_crop` | | val | `center_crop` | | test | `center_crop` | Use the same mode as training before the DINO image processor (size `448`). ## Test metrics (n=854) | Metric | Value | |--------|------:| | Accuracy | 100.0% | | Macro F1 | 1.000 | | AUC-ROC | 1.000 | | Loss | 0.1237 | ## Training config | Setting | Value | |---------|-------| | Stages | A + B + C | | Epochs A / B | 5 / 10 | | LR head A | 0.0005 | | LR backbone B | 5e-06 | | LR head B | 5e-05 | | Unfreeze blocks B | 4 | | Scheduler | `cosine_warmup` | | Class weights | `none` | | Label smoothing | 0.05 | ## Training history ![Training curves](training_history.png) Per-epoch metrics: `training_history.json` and `results.json` → `history`. ## Files | File | Description | |------|-------------| | `final_model.pt` | Weights + `idx_to_label` + test metrics | | `results.json` | Full training config, history, report | | `training_history.json` | Stage A/B epoch logs | | `confusion_matrix.json` | Machine-readable CM | | `confusion_matrix.png` | Plot | | `training_history.png` | Loss / F1 curves | | `model_card.json` | Summary metadata | | `config.yaml` | Training hyperparameters (copy) | | `inference_classifier.py` | CLI inference on image paths | ## Load weights ```python import torch ckpt = torch.load("final_model.pt", map_location="cpu", weights_only=False) print(ckpt["test_metrics"]) print(ckpt["idx_to_label"]) ``` ## Inference Use the same preprocessing...

Source context: 25 downloads · 0 likes · Pipeline image-classification · Library transformers · Repo BDRC/tibetan-page-orientation-classifier