Update README.md
Browse files
README.md
CHANGED
|
@@ -55,16 +55,13 @@ import json
|
|
| 55 |
output_dir="./ArMeme/"
|
| 56 |
os.makedirs(output_dir, exist_ok=True)
|
| 57 |
|
| 58 |
-
# Assuming the images are in a column named "image"
|
| 59 |
-
image_column = "image"
|
| 60 |
-
|
| 61 |
# Iterate over the dataset and save each image
|
| 62 |
for split in ['train','dev','test']:
|
| 63 |
jsonl_path = os.path.join(output_dir, f"arabic_memes_categorization_{split}.jsonl")
|
| 64 |
with open(jsonl_path, 'w', encoding='utf-8') as f:
|
| 65 |
for idx, item in enumerate(dataset[split]):
|
| 66 |
# Access the image directly as it's already a PIL.Image object
|
| 67 |
-
image = item[
|
| 68 |
image_path = os.path.join(output_dir, item['img_path'])
|
| 69 |
# Ensure the directory exists
|
| 70 |
os.makedirs(os.path.dirname(image_path), exist_ok=True)
|
|
|
|
| 55 |
output_dir="./ArMeme/"
|
| 56 |
os.makedirs(output_dir, exist_ok=True)
|
| 57 |
|
|
|
|
|
|
|
|
|
|
| 58 |
# Iterate over the dataset and save each image
|
| 59 |
for split in ['train','dev','test']:
|
| 60 |
jsonl_path = os.path.join(output_dir, f"arabic_memes_categorization_{split}.jsonl")
|
| 61 |
with open(jsonl_path, 'w', encoding='utf-8') as f:
|
| 62 |
for idx, item in enumerate(dataset[split]):
|
| 63 |
# Access the image directly as it's already a PIL.Image object
|
| 64 |
+
image = item['image']
|
| 65 |
image_path = os.path.join(output_dir, item['img_path'])
|
| 66 |
# Ensure the directory exists
|
| 67 |
os.makedirs(os.path.dirname(image_path), exist_ok=True)
|