TrOCR Base Handwritten (ONNX)

This is a mirror of onnx-community/trocr-base-handwritten-ONNX, which is itself an ONNX conversion of microsoft/trocr-base-handwritten for use with Transformers.js.

Why this mirror exists

Hosted here as a pinned, self-controlled dependency for a browser-based, offline-first PDF tool. Pinning the app to a specific commit on this repo means the handwriting recognition model can't change out from under the app without an explicit update.

Contents

Only the files needed are included (not the full set of quantization variants from the source repo):

  • onnx/encoder_model.onnx, onnx/encoder_model_fp16.onnx
  • onnx/decoder_model_merged.onnx, onnx/decoder_model_merged_fp16.onnx
  • tokenizer, preprocessor, and generation config files

Usage

import { pipeline } from '@huggingface/transformers';

const captioner = await pipeline(
  'image-to-text',
  'inYourOwnBrowser/trocr-base-handwritten-ONNX',
  { dtype: 'fp32' } // or 'fp16'
);

const output = await captioner(imageDataUrl);

Attribution

No changes were made to the model weights — this repo only re-hosts a subset of the original ONNX files.

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for inYourOwnBrowser/trocr-base-handwritten-ONNX

Quantized
(2)
this model

Paper for inYourOwnBrowser/trocr-base-handwritten-ONNX