/ Модель

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

Лицензия
Apache 2.0
Архитектура
hi_sam_sam_ts · dense
Базовая модель
Hi-SAM
Библиотека
pytorch
Опубликована
24 июл 2026

koharu-text-sam-ts-l

Сегментация изображенийИзображение → mask3 профессии

Модель на базе Hi-SAM выделяет пиксели текста на страницах японской манги и создаёт бинарные маски для последующей обработки.

87скачиваний за 30 дней2лайкавеса обновлены24 июл 2026

Бенчмарки

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

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

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

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

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

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

Koharu Text SAM-TS-L — модель сегментации текста на страницах манги, разработанная mayocream путём дообучения ViT-L Hi-SAM/SAM-TS TextSeg. Она выделяет пиксели текста и предназначена для подготовки масок текста при оцифровке манги и комиксов. Модель возвращает бинарную маску изображения; она не обнаруживает речевые пузыри, панели или отдельные текстовые строки и не распознаёт символы.

Полная модель содержит около 339 млн параметров и распространяется в формате SafeTensors; также доступно состояние обучаемого адаптера примерно на 30,7 млн параметров. На тестовых страницах из четырёх книг модель улучшила HR IoU относительно исходного TextSeg на 39 из 40 страниц. Обучение и оценка проводились на страницах японской манги из Manga109; лицензия весов — Apache-2.0.

Модель лучше работает с чётко напечатанным японским текстом. Мелкий текст, стилизованные звуковые эффекты, плотная верстка и текстоподобные иллюстрации остаются сложными случаями; для других стилей манги и комиксов возможен разрыв предметной области. Для запуска требуются Hi-SAM и его зависимости; модель не совместима напрямую с transformers.AutoModel и виджетом инференса Hugging Face.

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

  • создание масок текста на страницах манги
  • подготовка японских комиксов к распознаванию текста
  • выделение текстовых областей для последующего OCR
  • оценка и сравнение сегментации текста в манге

Ограничения

Мелкий текст, стилизованные звуковые эффекты, плотные страницы и текстоподобные рисунки могут сегментироваться хуже; перенос на стили вне Manga109 не гарантирован. Модель выдаёт только бинарную маску и не распознаёт текст, не выделяет экземпляры и не связывает текст с речевыми пузырями.

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

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

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

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

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

Открыть на Hugging Face

Koharu Text SAM-TS-L

koharu-text-sam-ts-l is a ViT-L Hi-SAM/SAM-TS TextSeg model fine-tuned for binary text segmentation on manga pages. It detects text pixels rather than speech balloons, panels, or individual text lines.

The model was fine-tuned from the SAM-TS-L TextSeg checkpoint from Hi-SAM. The released weights use SafeTensors only; no pickle checkpoint is required for the full model.

Files

FileContents
model.safetensorsComplete merged model state: 728 tensors, 338,934,897 elements
adapter_model.safetensorsFine-tuned trainable state only: 366 tensors, 30,650,149 elements
config.jsonArchitecture, preprocessing, and training configuration
evaluation.jsonAggregate book-disjoint evaluation results
inference.pyMinimal loading and full-page inference example

Use model.safetensors unless you specifically need the smaller adapter state. The full file loads strictly into a freshly constructed SAM-TS-L model and does not require the original SAM or TextSeg .pth files.

Results

Metrics use micro-averaged binary pixel counts. HR refers to the high-resolution SAM-TS output.

SplitModelHR IoUHR F-scoreHR precisionHR recall
Validation, 50 pages / 5 booksOriginal TextSeg0.41380.58540.87880.4388
Validation, 50 pages / 5 booksKoharu Text SAM-TS-L0.70620.82780.85130.8056
Test, 40 pages / 4 unseen booksOriginal TextSeg0.34610.51420.83650.3712
Test, 40 pages / 4 unseen booksKoharu Text SAM-TS-L0.62850.77190.77860.7653

The fine-tuned model improved HR IoU on 39 of the 40 test pages. Test HR IoU ranged from 0.5616 to 0.6977 across the four held-out books.

Training data

Training used the masks from Mask Dataset for: Unconstrained Text Detection in Manga: a New Dataset and Baseline by Julian del Gobbo and Rosana Matuk Herrera, licensed CC BY 4.0, paired locally with authorized Manga109 images. Manga109 images are not included in this model repository.

The split was deterministic and book-disjoint:

  • 36 training books: 359 full pages
  • 5 validation books: 50 full pages
  • 4 test books: 40 full pages
  • one empty-mask training page was excluded

The training stream contained 1,795 entries: 1,436 native 1024×1024 crops (80%) and 359 full pages resized and padded to 1024×1024 (20%). This model was not trained with the mayocream/manga109-segmentation dataset.

Training configuration

  • 20 epochs; best checkpoint at epoch 20
  • AdamW, weight decay 0.05
  • peak learning rate 1e-5
  • one-epoch warmup followed by cosine decay to 1e-6
  • batch size 16, BF16
  • NVIDIA B300 SXM6 AC
  • PyTorch 2.9.1 + CUDA 13.0

Usage

Clone Hi-SAM and install its dependencies, plus huggingface_hub and safetensors. The included command-line example loads the complete SafeTensors state and writes a binary PNG mask:

python inference.py input-page.jpg output-mask.png --hi-sam-root /path/to/Hi-SAM

Equivalent model-loading code:

from types import SimpleNamespace

from huggingface_hub import hf_hub_download
from safetensors.torch import load_file
from hi_sam.modeling.build import model_registry

args = SimpleNamespace(
    checkpoint=None,
    model_type="vit_l",
    attn_layers=1,
    prompt_len=12,
    hier_det=False,
)
model = model_registry["vit_l"](args=args)
weights = hf_hub_download(
    "mayocream/koharu-text-sam-ts-l", "model.safetensors"
)
model.load_state_dict(load_file(weights, device="cpu"), strict=True)
model = model.eval().cuda()

Inputs are RGB tensors in the 0–255 range. Resize the page so its longest side is 1024 pixels, pad the bottom and right sides to 1024×1024 with RGB value 128, and crop away the padding from the predicted mask before resizing it back to the original page size. inference.py implements this exact preprocessing.

Limitations

  • Evaluation covers 45 books and only the first ten pages of each book.
  • The model is strongest on clearly rendered Japanese manga text. Tiny text, stylized sound effects, dense pages, and text-like artwork remain difficult.
  • The output is binary text segmentation. It does not assign instances, recognize characters, or associate text with speech balloons.
  • Manga and comic styles outside Manga109 may have a larger domain gap.
  • Hi-SAM is custom research code, so this repository is not directly compatible with transformers.AutoModel or the hosted Hugging Face inference widget.

Reproducibility and integrity

The complete SafeTensors file was loaded with strict=True and reevaluated on all validation and test pages. It reproduced the original fine-tuned checkpoint metrics exactly in the local CUDA 13 evaluation environment.

ArtifactSHA-256
model.safetensorsbcd9525291677f467f0603509a0ca3df35711b4e3417cefce8da6bfc97164f45
adapter_model.safetensors78fd7140e5f8728c8d07f97163535c649390077811aad90e0e418c80504d8242
source epoch-20 checkpointebe1ed2bec50659dd4d22bd9fdb017117c15d5bc2acbef4588dfe3baf4d723f8

License and attribution

The model is released under Apache License 2.0, matching Hi-SAM and Segment Anything. The training masks are CC BY 4.0 and are attributed above. Use of Manga109 imagery remains subject to the Manga109 terms; no Manga109 images are redistributed here.

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

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

GPU в ailist

Универсальный рантайм · pytorch · image-segmentation

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

Архитектура hi_sam_sam_ts неизвестна transformers в образе рантайма.

Класс архитектуры
HiSam
Ревизия весов
5dd9742

0 моделей