-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathz.py
More file actions
36 lines (29 loc) · 819 Bytes
/
z.py
File metadata and controls
36 lines (29 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import os
import shutil
import json
candidates = [
"000181",
"000178",
"000169",
"000163",
"000162",
"000157",
"000082",
"000681",
"000756",
"000778",
"000905",
"000923"
]
for candidate in candidates:
prompt_path = f"./validation_data_512/{candidate}_final.txt"
image_path = f"./validation_data/{candidate}_final.png"
shutil.copy(prompt_path, f"./validation_data_edit/{candidate}_final.txt")
shutil.copy(image_path, f"./validation_data_edit/{candidate}_final.png")
json_dict = {}
with open(prompt_path, "r") as f:
json_dict["original_prompt"] = f.read()
json_dict["source_prompt"] = ""
json_dict["target_prompt"] = ""
with open(f"./validation_data_edit/{candidate}_final.json", "w") as f:
json.dump(json_dict, f)