Datasets:

Modalities:
Image
Text
Formats:
parquet
ArXiv:
Libraries:
Datasets
pandas
No description provided.
YuanLiuuuuuu changed pull request status to open

@HugoLaurencon We are MMBench team. Thanks for uploading the MMBench on HF. Would you like to merge this PR to update the dataset card? Thanks in advance.

@YuanLiuuuuuu @zsytony Just seeing this, thank you for the PR!

Note that this repo wasn't intended to be a proper integration of your dataset, it was just what was needed for us to evaluate our models. So, for example, we removed some columns, and only considered the dev split.

Here is the script that I used to create this dataset based on your files. You could do the same to have an official dataset page with all the available splits and columns.

import base64
from copy import deepcopy
from io import BytesIO

import datasets
import pandas as pd
from datasets import Dataset
from PIL import Image


PATH_MMBENCH_DATA = (  # DL from https://opencompass.org.cn/mmbench
    "/Users/hugolaurencon/Desktop/mmbench_dev_20230712.tsv"
)
NUM_PROC = 10
REPO_ID = "HuggingFaceM4/MMBench_dev"


data_frame = pd.read_csv(PATH_MMBENCH_DATA, sep="\t", header=0)


ds = Dataset.from_pandas(data_frame)
ds = ds.remove_columns(["index", "category", "source", "l2-category", "comment", "split"])
ds = ds.rename_column("answer", "label")


def map_func_transform_image_column(example):
    example["image"] = Image.open(BytesIO(base64.b64decode(example["image"])))
    return example


new_features = deepcopy(ds.features)
new_features["image"] = datasets.Image()
new_features["label"] = datasets.features.ClassLabel(names=["A", "B", "C", "D"])

ds = ds.map(map_func_transform_image_column, features=new_features, num_proc=NUM_PROC)

ds.push_to_hub(REPO_ID)
HugoLaurencon changed pull request status to merged

Sign up or log in to comment