数据集:
Bingsu/Gameplay_Images
来自 kaggle 的数据集。
这是一个包含世界上10款非常著名的电子游戏的数据集。
包括以下游戏:
每个类别有1000个图像,所有图像大小为640 x 360像素。它们的格式是.png。
此数据集是通过从Youtube上著名游戏玩法视频中每隔几秒保存一帧而创建的。
※ 此数据集于2022年1月上传。之后更新的游戏内容不包含在内。
CC-BY-4.0
>>> from datasets import load_dataset
>>> dataset = load_dataset("Bingsu/Gameplay_Images")
DatasetDict({
train: Dataset({
features: ['image', 'label'],
num_rows: 10000
})
})
>>> dataset["train"].features
{'image': Image(decode=True, id=None),
'label': ClassLabel(num_classes=10, names=['Among Us', 'Apex Legends', 'Fortnite', 'Forza Horizon', 'Free Fire', 'Genshin Impact', 'God of War', 'Minecraft', 'Roblox', 'Terraria'], id=None)}
下载:2.50 GiB 生成:1.68 GiB 总计:4.19 GiB
类别标签映射:
{
"Among Us": 0,
"Apex Legends": 1,
"Fortnite": 2,
"Forza Horizon": 3,
"Free Fire": 4,
"Genshin Impact": 5,
"God of War": 6,
"Minecraft": 7,
"Roblox": 8,
"Terraria": 9
}
>>> dataset["train"][0]
{'image': <PIL.PngImagePlugin.PngImageFile image mode=RGBA size=640x360>,
'label': 0}
| train | |
|---|---|
| # of data | 10000 |
>>> ds_new = dataset["train"].train_test_split(0.2, seed=42, stratify_by_column="label")
>>> ds_new
DatasetDict({
train: Dataset({
features: ['image', 'label'],
num_rows: 8000
})
test: Dataset({
features: ['image', 'label'],
num_rows: 2000
})
})