Introducing TextImage Augmentation for Document Images
Albumentations adds a TextImage transform that augments document images and their text annotations together, so vision-language models fine-tuned on small document datasets see text-preserving variations. It picks random text lines (fraction_range), applies word-level edits (random swap, deletion, or stopword insertion), blacks out and inpaints the original line, and re-renders the new text sized from the bounding box (font_size_fraction_range). The transform composes with other Albumentations transforms such as PlanckianJitter and Affine, returns the altered text and bounding boxes via overlay_data for training labels, and can render arbitrary text onto templates to generate synthetic data. Synonym replacement was dropped because of its time overhead.
Related posts
- A Dive into Vision-Language Models
Hugging Face hardMasterVision-language models pair an image encoder and a text encoder with a strategy for fusing the two, and the pre-training objective determines which downstream tasks they handle well. The main families are contrastive learning (CLIP, ALIGN, LiT), PrefixLM and frozen PrefixLM (SimVLM, Frozen, ClipCap, Flamingo), cross-attention fusion into language model layers (VisualGPT, FIBER), combined masked-language modeling and image-text matching (VisualBERT, FLAVA), and training-free methods (MaGiC, ASIF). Frozen-backbone approaches let teams train with limited aligned image-text data, while PrefixLM-only models are mostly limited to captioning and VQA. The post also surveys common pre-training datasets and shows how to experiment with these models in 🤗 Transformers.
- Open Preference Dataset for Text-to-Image Generation by the 🤗 Community
Hugging Face easyNoviceData is Better Together released an Apache 2.0 text-to-image preference dataset of 10K pairs, with over 30K annotations from more than 250 community members collected in under two weeks. Imgsys prompts were deduplicated, filtered for NSFW content with text and image classifiers plus manual review, and rewritten with distilabel across style categories and simple versus complex variants. Images came from FLUX.1-dev and Stable Diffusion 3.5 Large. Annotators found FLUX better for anime, manga and 3D, and SD3.5 better for cinematic and art styles. A LoRA fine-tune of FLUX-dev on the chosen samples improved its weaker art and cinematic outputs.
- Introducing Idefics2: A Powerful 8B Vision-Language Model for the community
Hugging Face easyNoviceIdefics2 is an 8B-parameter open (Apache 2.0) vision-language model that takes interleaved images and text and generates text, with strong OCR and document understanding. It scores at the top of its size class on VQA benchmarks and rivals LLaVA-NeXT-34B and MM1-30B-chat while using as few as 64 visual tokens per image. Compared with Idefics1, it handles images at native resolution and aspect ratio (NaViT-style, up to 980x980, with optional SPHINX-style sub-image splitting). It also drops gated cross-attention in favor of a SigLIP encoder, Perceiver pooling and an MLP projection concatenated with Mistral-7B text embeddings. The release includes The Cauldron, a 50-dataset instruction-tuning collection, plus Transformers inference code and a fine-tuning colab.
- Welcome PaliGemma 2 – New vision language models by Google
Hugging Face mediumAdeptPaliGemma 2 pairs Google's SigLIP image encoder with Gemma 2 text decoders, shipping pre-trained vision language models at 3B, 10B and 28B parameters, each at 224, 448 and 896 pixel input resolutions, plus 3B and 10B checkpoints fine-tuned on DOCCI for detailed captioning. The DOCCI fine-tunes cut factual errors in captions, with the 10B model scoring 20.3 non-entailment sentences versus 34.3 for the original PaliGemma. The models run in transformers 4.47+ and can be loaded with bitsandbytes quantization: a 3B checkpoint on TextVQA drops only from 60.04% to 58.72% accuracy at 4-bit nf4. LoRA fine-tuning on half the VQAv2 validation split took about 30 minutes on three 80GB A100s.
- PRX Part 4: Our Data Strategy
Hugging Face hardMasterPRX's pre-training corpus for a 7B text-to-image model is assembled from public and internal datasets, re-captioned with a VLM into long dense paragraphs, curated in Lance and streamed to training as Mosaic Data Shards. The pipeline favors breadth over aesthetic filtering and relies on faithful captions to turn imperfections like text or logos into promptable attributes. Measured decisions include storing images as JPEG quality 92, since PNG-vs-JPEG training runs were indistinguishable, and computing Qwen3-VL text latents on the fly for only a ~3–4% throughput cost. Over-fragmented Lance tables made queries slow until compaction to ~1M rows per fragment, and long Qwen2.5-VL captions clearly beat short LLaVA captions on FID, CMMD and DINO-MMD.