File size: 421 Bytes
5fa1a76 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
from datasets import load_dataset ds = load_dataset("scene_parse_150", split="train[:50]") Split the dataset's train split into a train and test set with the [~datasets.Dataset.train_test_split] method: ds = ds.train_test_split(test_size=0.2) train_ds = ds["train"] test_ds = ds["test"] Then take a look at an example: train_ds[0] {'image': , 'annotation': , 'scene_category': 368} image: a PIL image of the scene. |