/ Модель

Характеристики

Лицензия
CC BY-NC 4.0
Библиотека
keras
Опубликована
30 окт 2026

erdem-ocr-tr-tinyml

Описание изображенийИзображение → текст3 профессии

Компактная модель inviolus распознаёт заранее обрезанные строки печатного турецкого текста и рассчитана на запуск в условиях ограниченных ресурсов.

189скачиваний за 30 дней0лайковвеса обновлены11 ноя 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

erdem-ocr — компактная модель OCR, разработанная inviolus для распознавания одной заранее обрезанной строки печатного турецкого текста на устройствах класса микроконтроллеров. Она принимает изображение в градациях серого размером 160×32 и использует сверточные блоки, двунаправленные LSTM и декодирование CTC. Веса доступны в формате Keras и как полноценно квантованная до int8 модель TensorFlow Lite; модель содержит около 631 тыс. параметров и выдаёт последовательность до 24 символов из турецкого набора букв, цифр и знаков препинания.

Модель предназначена для встраиваемого распознавания печатных строк, например на маломощных устройствах. Она не обнаруживает текст и не обрабатывает целые страницы: изображение строки нужно подготовить заранее. На чистых печатных строках качество выше, чем на реальном сценическом тексте; для опубликованного int8-файла автор сообщает существенное снижение точности относительно float-модели и рекомендует считать его экспериментальным. Лицензия — CC BY-NC 4.0, для некоммерческого использования.

Сценарии применения

  • распознавание печатных турецких строк на микроконтроллере
  • чтение коротких строк с подготовленных изображений
  • извлечение текста из чистых сканов турецких надписей

Ограничения

Модель обрабатывает только одну заранее обрезанную строку печатного текста: обнаружение текста и обрезка не включены, рукописный и полноформатный текст не поддерживаются. Качество на сценическом тексте ограничено, а int8-экспорт заметно уступает float-модели и обозначен автором как экспериментальный.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

erdem-ocr: Turkish line OCR for microcontrollers

Replaced: use inviolus/InviolusOCR instead. It comes in three int8 sizes, Base (598 KB), Small (298 KB) and Nano (171 KB), and even Nano reads 65% of held-out lines exactly; this 2026-10-09 model reads 33% as int8.

A compact CNN + BiLSTM + CTC recognizer for one cropped line of printed Turkish text, built to eventually run on a microcontroller-class device. It ships as a float Keras model and a full-int8 TensorFlow Lite model (~650 KB).

Türkçe özet: Mikrodenetleyiciler için tasarlanmış, tek satır basılı Türkçe metni okuyan küçük bir OCR modeli (yaklaşık 631 bin parametre, int8 TFLite dosyası yaklaşık 650 KB). Ticari olmayan kullanım içindir (CC BY-NC 4.0).

Files

FileWhat it is
erdem_ocr.kerasFloat recognition model, input (batch, 32, 160, 1), output (batch, 40, 90) softmax
erdem_ocr_int8.tfliteFull-int8 export, static batch 1, input [1, 32, 160, 1] int8, output [1, 40, 90] int8
alphabet.jsonCharacter set and blank index used to decode the output

Model

  • Input: one horizontal text line, grayscale, resized to 160×32 (width×height), scaled to [-1, 1] (pixel / 127.5 - 1).
  • Architecture: 4 conv + batch-norm + pool blocks, 2 × bidirectional LSTM (96 units), dense softmax. 631,226 parameters.
  • Output: 40 timesteps × 90 classes. Class 0 is padding (never predicted), classes 1..88 are the characters of alphabet.json in order, class 89 is the CTC blank.
  • Character set: digits, ASCII letters, ç ğ ı İ ö ş ü Ç Ğ Ö Ş Ü, space and .,:;!?-_/()'%. Up to 24 characters per line.
  • Decoding: greedy CTC (argmax per step, collapse repeats, drop blanks).
  • int8 quantization: input scale 0.00784, zero point -1; output scale 0.00390625, zero point -128.
  • Not included: text detection. The model expects a line that has already been cropped.

Usage

import json
import numpy as np
import tensorflow as tf

alphabet = json.load(open("alphabet.json", encoding="utf-8"))["alphabet"]
BLANK = len(alphabet) + 1

def preprocess(path):
    image = tf.io.decode_image(tf.io.read_file(path), channels=1, expand_animations=False)
    image = tf.image.resize(image, [32, 160])
    return (tf.cast(image, tf.float32) / 127.5 - 1.0).numpy()

def decode(ids):
    text, previous = [], None
    for i in ids:
        if i != previous and 0 < i < BLANK:
            text.append(alphabet[i - 1])
        previous = i
    return "".join(text)

model = tf.keras.models.load_model("erdem_ocr.keras", compile=False)
probabilities = model.predict(preprocess("line.png")[np.newaxis])
print(decode(probabilities[0].argmax(-1)))

Results

Exact-line accuracy (whole line correct) and character error rate (CER) of the float model, on data it was not trained on:

Test setSamplesExact lineCER
TS-TR official test split (real scene text)2,07845.33%24.17%
Held-out synthetic + real + Zenodo lines3,23458.23%12.61%
of which Zenodo (clean printed lines)20091.00%1.61%
Small real-photo test set6619.70%50.21%

int8 TFLite model: on the 3,993-row held-out split it reads 10.5% of lines exactly (CER 21.7%), against 55.7% for the float model. The quantization loss is large and unresolved, so treat the .tflite file as an experimental export.

Limitations

  • Printed text only; no handwriting, curved text or full pages.
  • Works best on clean, high-contrast lines; real scene text is still weak.
  • The int8 model loses most of the float model's accuracy (see above).
  • Text detection and line cropping must be done before this model runs.

Training data

Training/validation splits are group-disjoint (no font, background or source group appears in both).

License

Because the training data includes TS-TR (CC BY-NC 4.0), this model is released under Creative Commons Attribution-NonCommercial 4.0:

  • You may use, share and adapt the model for non-commercial purposes.
  • You must credit this model and the datasets listed above.
  • Commercial use is not permitted.

The training code is licensed under the Apache License 2.0 with a NOTICE file (earlier commits MIT): ErdemWilkinson/InviolusOCR.

Version

Trained 2026-10-09. Later versions of this model score higher (65% exact on TS-TR) but were trained with a dataset whose license is not stated, so they are not published here.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · keras

Нельзя запустить

Keras/TensorFlow-модели рантайм не загружает.

Ревизия весов
6397b09

0 моделей