martialroberge
commited on
Commit
·
135eb76
1
Parent(s):
082b0cb
fix: uniformisation de la structure des fichiers JSONL en ajoutant le champ file_name
Browse files- recover_missing_images.py +3 -1
- test/metadata.jsonl +0 -0
- validation/metadata.jsonl +0 -0
recover_missing_images.py
CHANGED
|
@@ -33,9 +33,11 @@ def update_jsonl_from_json(json_file, jsonl_file):
|
|
| 33 |
with open(json_file, 'r', encoding='utf-8') as f:
|
| 34 |
json_data = json.load(f)
|
| 35 |
|
| 36 |
-
# Convertir en format JSONL
|
| 37 |
jsonl_lines = []
|
| 38 |
for item in json_data:
|
|
|
|
|
|
|
| 39 |
jsonl_lines.append(json.dumps(item, ensure_ascii=False))
|
| 40 |
|
| 41 |
# Écrire le JSONL
|
|
|
|
| 33 |
with open(json_file, 'r', encoding='utf-8') as f:
|
| 34 |
json_data = json.load(f)
|
| 35 |
|
| 36 |
+
# Convertir en format JSONL avec le champ file_name
|
| 37 |
jsonl_lines = []
|
| 38 |
for item in json_data:
|
| 39 |
+
# Ajouter le champ file_name qui est le même que le champ image
|
| 40 |
+
item['file_name'] = item['image']
|
| 41 |
jsonl_lines.append(json.dumps(item, ensure_ascii=False))
|
| 42 |
|
| 43 |
# Écrire le JSONL
|
test/metadata.jsonl
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
validation/metadata.jsonl
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|