File size: 576 Bytes
08480b0
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
from pathlib import Path
from datasets import load_dataset
from io_utils import decode_record
root = Path(__file__).resolve().parents[1]
for config in ('text_adversarial_curated','text_injection_curated','image_perturbation_curated','image_overlay_curated','image_instruction_curated'):
    ds = load_dataset(str(root), config, split='test')
    row = ds[0]
    record = decode_record(row)
    print(config, len(ds), record['id'], record['task'], record['gt'])
    if 'clean_image' in row:
        print('Decoded image sizes:', row['clean_image'].size, row['adv_image'].size)