File size: 556 Bytes
f09f8fd
 
 
 
 
9936396
f09f8fd
 
9936396
f09f8fd
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import pandas as pd
from PIL import Image
import PIL

image_path = '/Users/amansolanki/datasets/hateful-memes-images/'
image_save_path = '/Users/amansolanki/hateful-memes/images/'
test_seen_original = pd.read_csv('/Users/amansolanki/PycharmProjects/hateful-memes-challenge/data/test_seen.csv')

demo_data = test_seen_original.sample(50, random_state=7)

# Save Images
for image in demo_data['image_id']:
    picture = Image.open(image_path+image)
    picture = picture.save(image_save_path+image)

# Save CSV
demo_data.to_csv('demo_data.csv', index=False)