2xText2HD v1

Makes low-quality scans of text sharp and readable at 2×.

A RealPLKSR model for upscaling low-quality text, such as poor scans and photos of documents, into clear, legible pages. It works best on moderately sized text rather than very small print.

Scale
2×
Parameters
7.4M
CPU time per 256 px tile
3.9s
ONNX file
30MB

Example output

Drag the handle to compare. Produced by running this model.

After: Input: a 260 × 130 px low-quality scan of printed text. Output: the model's 2× result.
Before: Input: a 260 × 130 px low-quality scan of printed text. Output: the model's 2× result.
BeforeAfter
Input: a 260 × 130 px low-quality scan of printed text. Output: the model's 2× result.

Technical details

Architecture
RealPLKSR (partial large kernel CNN)
Training data
Scanned books and text
Training
168,000 iterations
ONNX build
FP32, opset 17, any image size
Input
RGB, NCHW, values 0–1
Benchmark
ONNX Runtime CPU, Apple M2 Pro
Original release
27 August 2024

Good for

  • Scanned documents
  • Photos of receipts and pages
  • Screenshots of text

Run it in Flutter

This model runs as-is with our open-source flutter_super_resolution package (MIT), which tiles large images and uses Core ML on Apple devices when available. It works on iOS, Android (ARM devices), macOS and Windows.

pubspec.yaml · Darttext2xhigh.onnx
dependencies:
  flutter_super_resolution: ^1.1.1

// Load the model, then upscale a ui.Image
final upscaler = FlutterUpscaler(tileSize: 128, overlap: 8);
await upscaler.initializeModel('assets/models/text2xhigh.onnx');

final result = await upscaler.upscaleImage(
  image,
  scale: 2,
  onProgress: (progress, message) => print('$message ${(progress * 100).round()}%'),
);

upscaler.dispose();

Files in our release

The same model can ship under more than one name. Check the SHA-256 to confirm a download.

FileSizeSHA-256
text2xhigh.onnx29.9 MBc35d9932715a659d…

Related models

All models

Credits and license

Original model
2xText2HD v1
Created by
asterixcool (Starinspace)
Changes
Converted from PyTorch to an FP32 ONNX file

Shared under CC BY-SA 4.0: if you adapt this model, share the result under the same license.

Check the license terms before using this model in a product. More copyleft models

Building with AI?

Our models are available as APIs for teams who want to build on them. Tell us what you're working on.

Get in touch