{ "cells": [ { "cell_type": "code", "execution_count": null, "id": "9781d39a", "metadata": {}, "outputs": [], "source": [ "import gradio as gr\n", "from datasets import load_dataset\n", "from PIL import Image\n", "import io\n", "\n", "# 载入数据集\n", "ds = load_dataset(\"ziyjiang/MMEB_Test_Instruct\",'CIRR', split=\"test\")\n" ] }, { "cell_type": "code", "execution_count": 10, "id": "9ec4e59b", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Dataset({\n", " features: ['qry_text', 'qry_img_path', 'tgt_text', 'tgt_img_path', 'qry_inst', 'tgt_inst'],\n", " num_rows: 1000\n", "})\n" ] } ], "source": [ "print(ds)" ] }, { "cell_type": "code", "execution_count": 24, "id": "74b9890f", "metadata": {}, "outputs": [], "source": [ "sample = ds[0]" ] }, { "cell_type": "code", "execution_count": 25, "id": "f4920794", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "qry_text:Show three bottles of soft drink.\n", "tgt_text\n", "qry_inst<|image_1|>\n", "Given an image, find a similar everyday image with the described changes:\n", "tgt_inst<|image_1|>\n", "Represent the given image.\n", "\n" ] } ], "source": [ "print(\"qry_text:\"+ str(sample[\"qry_text\"]))\n", "print(\"tgt_text\"+str(sample[\"tgt_text\"][0]))\n", "print(\"qry_inst\"+str(sample[\"qry_inst\"]))\n", "print(\"tgt_inst\"+str(sample['tgt_inst']))" ] } ], "metadata": { "kernelspec": { "display_name": "VLMtoVec", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.18" } }, "nbformat": 4, "nbformat_minor": 5 }