ret-sample
收藏资源简介:
ret-sample 是一个用于组合图像检索(CIR)的数据集,包含 3,127 对查询-正样本图像对,总大小约 341 MB,分为 8 个分片。每对样本由一张查询图像和一条文本指令构成,用于检索目标正样本图像。数据集专为 williamium3000/Qwenvl2d5 项目设计,支持流式加载,无需外部凭据。列字段包括:q_image(查询图像,PIL格式)、pos_image(正样本图像)、instruction(检索指令文本)、caption(正样本图像的描述)、q_key 和 pos_key(基于Blake3哈希的内容标识符)、group_id(近重复聚类ID)、n_text_tokens(指令的Qwen2.5-VL分词器长度)、task(固定为cir)、subset(来源子集)。注意:数据集中不包含硬负例,训练时使用批内InfoNCE损失;图像以未解码的原始JPEG字节存储,预处理时解码为PIL图像,保证无损。数据集源图像来自jeffrey/reasoning_retrieval数据集。
ret-sample is a dataset for Composed-Image-Retrieval (CIR), containing 3,127 query-positive image pairs, total size approximately 341 MB, split into 8 shards. Each pair consists of a query image and a text instruction used to retrieve a target positive image. The dataset is designed for the williamium3000/Qwenvl2d5 project, supports streaming loading, and requires no external credentials. Columns include: q_image (query image in PIL format), pos_image (positive image), instruction (retrieval instruction text), caption (description of positive image), q_key and pos_key (content identifiers based on Blake3 hash), group_id (near-cluster ID), n_text_tokens (instruction token length for Qwen2.5-VL tokenizer), task (fixed as cir), and subset (source subset). Note: The dataset does not contain hard negatives and uses in-batch InfoNCE loss during training. Images are stored as raw JPEG bytes without decoding and are decoded to PIL images during preprocessing to ensure lossless quality. Source images come from the jeffrey/reasoning_retrieval dataset.
Icey444/ret-sample 数据集概述
基本信息
- 数据集地址:https://huggingface.co/datasets/Icey444/ret-sample
- 许可证:MIT
- 语言:英语(en)
- 任务类别:图像到图像(image-to-image)、视觉文档检索(visual-document-retrieval)
- 标签:retrieval、multimodal、composed-image-retrieval
- 数据规模:1K < n < 10K
- 配置名称:default
数据集简介
该数据集为 Composed-image-retrieval(CIR)风格的配对数据:由一个查询图像 + 指令检索一个目标图像。图像直接嵌入在 parquet 文件中,训练或浏览时无需依赖任何外部资源。
- 3,127 对数据 · 8 个分片 · 341 MB
- 为
williamium3000/Qwenvl2d5(ret-streaming-retsample分支)构建,可由其流式加载且无需 S3 凭证。
数据划分
- train:路径为
pairs_img/train-*.parquet
列说明
| 列名 | 类型 | 含义 |
|---|---|---|
q_image |
Image() |
查询图像(访问时为 PIL;以原始 JPEG 字节存储) |
pos_image |
Image() |
正样本/目标图像 |
instruction |
string | 查询指令(需要检索什么) |
caption |
string | 正样本的标题 |
q_key, pos_key |
string | blake3(raw file bytes)[:16] 内容 ID |
group_id |
int | 近重复簇 ID(teacher 余弦相似度 ≥ 0.98) |
n_text_tokens |
int | 指令的精确长度,基于 Qwen2.5-VL 分词器 |
task, subset |
string | cir;来源子集(results / instruct / …) |
使用方式
加载数据集: python from datasets import load_dataset ds = load_dataset("Icey444/ret-sample", split="train") r = ds[0] r["q_image"] # PIL.Image r["instruction"] # "What would I need to use to navigate through a place like this?" r["pos_image"] # PIL.Image
训练(在上述仓库中): bash bash scripts/sft_ret_sample_streaming.sh # --dataset ret_sample%100
备注
- 无难负样本(No hard negatives)。 训练代码使用 in-batch InfoNCE;其 collator 明确不支持每个实例的第 3 个条目,因此挖掘的负样本会被携带但永远不会被读取。
- 图像以未解码形式存储,并在预处理时一次性解码为 PIL —— 无损(已验证通过流水线后字节一致),且无需每个 epoch 重新编码。
- 源图像来自 zillion2 存储上的
jeffrey/reasoning_retrieval;_key列为这些精确字节的内容哈希。




