/ Модель

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

Лицензия
Своя лицензия
Базовая модель
Qwen2.5-VL-3B-Instruct
Библиотека
transformers
Опубликована
14 сен 2026

Unitranslator

Преобразование изображенийИзображение, текст → изображение

UniTranslator переводит текст на изображениях и создаёт отредактированное изображение с переводом, сохраняя исходную компоновку.

0скачиваний за 30 дней3лайкавеса обновлены14 сен 2026

Бенчмарки

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

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

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

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

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

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

UniTranslator — модель лаборатории SeerRay-Lab для сквозного машинного перевода текста прямо внутри изображений. Она принимает изображение и исходный и целевой языки, предсказывает перевод, а затем создаёт отредактированное изображение с переводом в исходных текстовых областях, стараясь сохранить сцену, расположение элементов и типографику. Архитектура объединяет мультимодальную ветвь на основе Qwen2.5-VL-3B-Instruct, генеративную ветвь на основе FLUX.1-Kontext-dev и специальные модули UGAM для согласования понимания и генерации и SMD для локализации текстовых областей. В репозитории также есть адаптер LoRA для Qwen2.5-VL.

Модель оценивалась для направлений немецкий→английский, английский→немецкий, французский→английский, румынский→английский, английский→французский, английский→чешский, английский→русский и английский→румынский; качество для других направлений не гарантируется. По данным статьи, при её условиях оценки обработка занимала около 9,51 секунды на изображение и требовала около 50 ГБ пиковой видеопамяти. Для запуска нужны пользовательские классы из репозитория проекта и доступ к gated-модели FLUX.1-Kontext-dev; модель не совместима напрямую с AutoPipeline и размещённым API Hugging Face. Лицензия указана как other, а для FLUX требуется отдельно принять условия её лицензии. Ограничения включают ошибки перевода и отрисовки символов для малообеспеченных языков, сложностей с декоративным, мелким и низкокачественным текстом, а также возможные изменения фона за пределами текстовой области.

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

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

Ограничения

Для неоценённых языковых направлений качество не гарантируется; мелкий, плотный, изогнутый, перекрытый и стилизованный текст может переводиться или отрисовываться с ошибками. Генерация способна затронуть фон за пределами текстовой области, а для запуска нужны пользовательские классы проекта, gated-доступ к FLUX.1-Kontext-dev и видеопамять высокого объёма.

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

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

Открыть на Hugging Face

UniTranslator

A Unified Multimodal Framework for End-to-End In-Image Machine Translation

UniTranslator, accepted at ECCV 2026, is an end-to-end framework for in-image machine translation (IIMT). Given an image and a translation instruction, it predicts the translated text and renders that translation back into the source text regions while preserving the surrounding scene, layout, and typography as closely as possible.

UniTranslator overview

UniTranslator introduces two components:

  • Understand-Generation Alignment Module (UGAM): aligns translation-understanding representations with the image-generation condition, reducing semantic inconsistency between predicted and rendered text.
  • Spatial Mask Decoder (SMD): adds pixel-level supervision over text regions to improve localization, geometric alignment, and layout-preserving text replacement.

This repository contains a research checkpoint that uses custom model classes from the GitHub repository. It is not directly compatible with AutoPipeline.from_pretrained("SeerRay-Lab/Unitranslator") or the hosted Hugging Face Inference API.

Model details

PropertyDescription
TaskEnd-to-end in-image machine translation
InputSource image, source language, and target language
OutputPredicted translation text and an edited image containing the translated text
Multimodal backboneQwen2.5-VL-3B-based checkpoint
Image generatorFLUX.1-Kontext-dev-based denoiser
Main componentsUGAM and SMD
TrainingTwo-stage warm-up and joint fine-tuning
Recommended precisionBF16

The released checkpoint combines a multimodal understanding branch, a FLUX-based generation branch, and task-specific alignment and spatial-supervision modules. Inference first autoregressively predicts the translation and then uses the resulting representation to condition image generation.

Supported and evaluated translation directions

The paper evaluates the following directions:

  • German → English (De → En)
  • English → German (En → De)
  • French → English (Fr → En)
  • Romanian → English (Ro → En)
  • English → French (En → Fr)
  • English → Czech (En → Cs)
  • English → Russian (En → Ru)
  • English → Romanian (En → Ro)

Other language directions are not guaranteed to provide comparable quality.

Checkpoint contents

PathPurpose
univa/Final combined UniTranslator task checkpoint, including the multimodal model, denoiser, UGAM, and SMD weights
lora/Rank-64 LoRA adapter used in stage-two Qwen2.5-VL fine-tuning
denoise_projector.binStandalone denoise-projector/UGAM checkpoint artifact
pytorch_model/DeepSpeed training state for resuming training
random_states_*.pkl, scheduler.bin, latestTraining-resume metadata

For inference, download univa/ and lora/. The large DeepSpeed optimizer and random-state files are not required.

Installation

git clone https://github.com/SeerRay-Lab/Unitranslator.git
cd Unitranslator

conda create -n univa python=3.10 -y
conda activate univa
pip install -r requirements.txt
pip install flash_attn --no-build-isolation

The reference environment uses PyTorch 2.7.1, Transformers 4.57.0, Diffusers 0.32.2, Accelerate 1.5.2, and PEFT 0.10.0.

Download

Download only the files needed for inference:

hf download SeerRay-Lab/Unitranslator \
  --include "univa/*" \
  --include "lora/*" \
  --local-dir checkpoints/Unitranslator

UniTranslator also depends on Qwen2.5-VL-3B-Instruct and FLUX.1-Kontext-dev:

hf download Qwen/Qwen2.5-VL-3B-Instruct \
  --local-dir checkpoints/Qwen2.5-VL-3B-Instruct

hf download black-forest-labs/FLUX.1-Kontext-dev \
  --local-dir checkpoints/FLUX.1-Kontext-dev

FLUX.1-Kontext-dev is gated. You must first accept its license on the model page and authenticate with Hugging Face.

Inference

1. Construct the base hybrid checkpoint

The released inference code reconstructs the base Qwen2.5-VL + FLUX hybrid model before loading the UniTranslator task weights and LoRA adapter:

python scripts/make_univa_qwen2p5vl_tf.py \
  --origin_qwenvl_ckpt_path checkpoints/Qwen2.5-VL-3B-Instruct \
  --origin_flux_ckpt_path checkpoints/FLUX.1-Kontext-dev \
  --save_path checkpoints/UniWorld_Kontext_3b_TF

2. Translate a directory of images

python infer_dir_tf.py \
  --base_model_path checkpoints/UniWorld_Kontext_3b_TF \
  --lora_adapter_path checkpoints/Unitranslator/lora \
  --flux_finetune_path checkpoints/Unitranslator/univa \
  --flux_base_path checkpoints/FLUX.1-Kontext-dev \
  --input_dir path/to/input_images \
  --output_dir results/de_to_en \
  --gpu_id 0 \
  --total_gpus 1 \
  --source_language German \
  --target_language English \
  --dtype bf16 \
  --height 1024 \
  --width 1024 \
  --num_inference_steps 50 \
  --guidance_scale 5.0

The generated images and a JSONL file containing the predicted translations are written to --output_dir.

For multi-GPU directory inference, launch one process per GPU with different --gpu_id values and the same --total_gpus. Input images are assigned to processes by round-robin sharding.

The prompt format used by the inference script is:

Translate all {source_language} texts into {target_language}.

Hardware note

The paper reports approximately 50 GB peak GPU memory and 9.51 seconds per image under its evaluation setting. Actual memory use and latency depend on resolution, precision, hardware, and inference steps. A high-memory CUDA GPU is recommended.

Training

UniTranslator uses a two-stage training strategy:

  1. Module warm-up: freeze the pretrained Qwen2.5-VL and diffusion backbones and optimize the task-specific alignment and spatial modules.
  2. Joint fine-tuning: jointly train the understanding and generation paths, including rank-64 Qwen2.5-VL LoRA adapters, UGAM, SMD, and MMDiT attention projections.

The paper reports BF16 mixed precision, AdamW, gradient checkpointing, gradient accumulation of 8, and NVIDIA H800 GPUs. See the configuration files under scripts/denoiser/ for the released training setup.

The repository provides train_stage1.sh and train_stage2.sh as reference launchers. Update their configuration paths for your environment before running them; the checked-in scripts and YAML files contain project-local paths and may require adaptation.

Data preparation

# Stage-one supervision
python convert_en_de.py

# Stage-two mask supervision
python convert_transv_mask.py

Datasets used by the project include:

Users are responsible for complying with the licenses and terms of each dataset.

Evaluation results

All numbers below are reported in the UniTranslator paper.

Translatotron-V

DirectionBLEU ↑Structure-BLEU ↑SSIM ↑
De → En25.0324.860.8184
En → De13.4113.360.7887
Fr → En27.7727.140.8060
Ro → En18.4518.290.8045

IIMT30k test set

DirectionBLEU ↑COMET ↑FID ↓
De → En14.759.88.9
En → De13.045.512.5

PRIM

SystemAverage BLEU ↑Average COMET ↑Average FID ↓
Translatotron-V1.432.269.1
VisTrans11.347.028.8
UniTranslator12.850.722.9

BLEU and COMET evaluate translation quality, Structure-BLEU additionally considers text-region alignment, SSIM measures source/target structural similarity, and FID evaluates generated-image distribution quality.

UniTranslator results

Limitations and risks

  • Low-resource language settings may produce missing words or incorrect character rendering.
  • Highly stylized typography can lead to imperfect preservation of strokes, glow, erosion, or cursive deformation.
  • Complex backgrounds may be altered outside the intended text region, including texture, color, or local appearance changes.
  • Small, dense, curved, occluded, or low-resolution text remains challenging.
  • Results may vary for language directions and domains not represented in the evaluated datasets.
  • Generated translations and images should be verified before use in safety-critical, legal, medical, financial, or public-facing contexts.
  • Input images may contain personal or copyrighted material; users are responsible for lawful processing and distribution.

License

The source code repository is released under the Apache 2.0 License.

The released model is based in part on FLUX.1-Kontext-dev. Use of the model weights is therefore also subject to the FLUX.1 Dev Non-Commercial License and its Acceptable Use Policy. Users must comply with all applicable upstream model and dataset licenses; the more restrictive terms apply where relevant.

Citation

If you find this work useful, please cite:

@article{lyu2026unitranslator,
  title={UniTranslator: A Unified Multi-modal Framework for End-to-end In-Image Machine Translation},
  author={Lyu, Jiahao and Fu, Pei and Li, Zhenhang and Zhang, Shaojie and Yang, Jiahui and Ma, Can and Zhou, Yu and Luo, Zhenbo and Luan, Jian},
  journal={arXiv preprint arXiv:2606.24333},
  year={2026}
}

Acknowledgements

This project builds on UniWorld, Qwen2.5-VL, and FLUX.1-Kontext-dev. See the paper and GitHub repository for the complete acknowledgements.

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

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

GPU в ailist

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

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

Модели «картинка → картинка» пока не запускаются.

Ревизия весов
9f2bc3e

0 моделей