--- license: apache-2.0 task_categories: - image-to-text size_categories: - 1M.jpg` - `.txt` (the long caption) ## Load ```python from datasets import load_dataset ds = load_dataset( "webdataset", data_files="https://huggingface.co/datasets/IntelligenceLab/BLIP3o-Recap/resolve/main/*.tar", split="train", ) ``` For local files: ```python import glob from datasets import load_dataset ds = load_dataset("webdataset", data_files=glob.glob("/path/to/shards/*.tar"), split="train") ``` ## Recaptions `recaptions/.parquet` holds, for every image of `.tar` (same order, 1,000,000 rows in total), the original caption and two new captions written by [Qwen2.5-VL-3B-Instruct](https://huggingface.co/Qwen/Qwen2.5-VL-3B-Instruct). The images are not duplicated; join on `key`. | Column | Content | | --- | --- | | `key` | example key in the tar (`.jpg`) | | `source_shard` | tar file name | | `orig_caption` | the original `.txt` caption | | `recap_1`, `recap_2` | two new captions, one paragraph each | ```python from datasets import load_dataset recaps = load_dataset( "parquet", data_files="hf://datasets/IntelligenceLab/BLIP3o-Recap/recaptions/*.parquet", split="train", ) ``` ### Generation - Model: `Qwen/Qwen2.5-VL-3B-Instruct`, vLLM 0.31.0, bf16, images capped at 640×28×28 pixels. - Code: [`code/recaption.py`](code/recaption.py) (`run`, `fix`, `stats`, `export`) and [`code/launch.sh`](code/launch.sh) (one worker per GPU). - Both captions are two samples (`n=2`) of the same prompt: temperature 0.8, top-p 0.9, at most 160 new tokens. - Prompt (verbatim): ```text System: You are an image captioner. Describe only what is visible. User: Describe this image in ONE paragraph of 70–90 words. Order: main subject(s) (count, category, color, size, pose/action) → spatial relations (left/right, front/behind, near/far) → background and setting → lighting, viewpoint, and medium (photo, illustration, 3D render, etc.). Rules: - Start directly with the main subject. Never begin with "The image", "This picture", "In this photo", or similar. - State only what is clearly visible. No guesses ("likely", "possibly", "suggesting", "appears to be"), no mood words ("serene", "vibrant", "charming", "picturesque"), no interpretation of purpose or meaning. - Quote visible text only if it is legible. - No lists, no line breaks, no concluding summary sentence. ``` ### Constraints and filtering The 3B model ignores parts of the prompt (without intervention about 60% of captions start with "The image …" and about 80% contain a banned word), so the rules are also enforced while decoding and checked afterwards. **Banned while decoding** (every casing and leading-space token form, through vLLM `bad_words` and `logit_bias`): - words from the prompt: likely, possibly, appears, suggesting, serene, vibrant, charming, picturesque; - their inflections and the substitutes the model switched to: appear(ed/ing), suggest(s/ed), seem(s/ed/ingly), indicat(e/es/ed/ing/ive), perhaps, probably, might, possible, potentially, presumably, apparently, supposedly, hint(s/ing), impl(ies/ying), impression; - mood and interpretive words: tranquil, peaceful, idyllic, cozy, inviting, stunning, breathtaking, bustling, overall, atmosphere, ambiance, ambience, calm, lively, festive, scenic, striking, dramatic, majestic, grand, dynamic, typical, emphasiz(e/es/ed/ing), enjoy(s/ing), welcoming, relax(ed/ing), pleasant, playful, harmonious, elegant, whimsical, energetic, cheerful, celebratory, celebrating, intimate, aesthetic, iconic, mood, moody; - phrases: "creating a", "sense of", "giving a / it / the scene / the image", "adding a", "natural beauty", "looks like", "what looks", "could be", "may be"; - openers: "The / This / These" + image, picture, photo, photograph, scene, illustration, snapshot; "In this", "In the image / picture / photo"; and "The", "This", "These" as the first word. **Rejected and resampled** (up to 3 times): an opener or banned word outside quotes (quoted visible text is kept verbatim), a line break or list, fewer than 60 words, or Chinese / Japanese / Korean characters outside quotes (the model sometimes drifts into Chinese mid-sentence). A caption cut off at 160 tokens keeps its complete sentences. There is no upper word limit. The banned list grew in three rounds while inspecting outputs; after the main run, every caption that violated the final rules (110,176 of 2,000,000) was regenerated with the final rules. No other caption was changed. ### Statistics | | | | --- | ---: | | captions that still violate a rule | 0.02% (439 images) | | words per caption (p5 / median / p95) | 63 / 81 / 108 | | recap_1 vs recap_2, same image: bigram Jaccard / ROUGE-L | 0.157 / 0.394 | | recap_1 vs recap_2, different images: bigram Jaccard / ROUGE-L | 0.041 / 0.231 | | recap_1 vs original caption: bigram Jaccard / ROUGE-L | 0.091 / 0.289 | The two captions of an image share the prompt's fixed sentence order but differ in wording and detail; on average 57% of the content words of `recap_2` do not occur in `recap_1`. ### Known limitations These are small-model captions. A manual check of 16 captions found the main subject, colors, setting, medium and legible text correct in all of them, but about a third had one wrong secondary detail: left/right or front/back orientation, an object count, or an invented small object. The two captions of an image rarely make the same error. Some interpretive phrasing that is not on the banned lists remains. ## License Apache-2.0, same as the source dataset.