Upload data.py with huggingface_hub
Browse files
data.py
CHANGED
@@ -33,7 +33,7 @@ def slove_images(bytes,path):
|
|
33 |
#print(data[0][2].keys())
|
34 |
|
35 |
file_path = '/home/zbz5349/WorkSpace/aigeeks/Qwen2.5-VL/magicbrush_dataset/data'
|
36 |
-
image_path = '/home/zbz5349/WorkSpace/aigeeks/Qwen2.5-VL/magicbrush_dataset/
|
37 |
os.makedirs(image_path,exist_ok=True)
|
38 |
|
39 |
save_data = []
|
@@ -42,7 +42,7 @@ for sud_ in os.listdir(file_path):
|
|
42 |
print(sud_)
|
43 |
data = read_parquet(os.path.join(file_path,sud_))
|
44 |
for x in data:
|
45 |
-
img_path = os.path.join(
|
46 |
## 在 Linux 放开
|
47 |
slove_images(x[2]['bytes'],img_path)
|
48 |
message = {
|
@@ -52,14 +52,14 @@ for sud_ in os.listdir(file_path):
|
|
52 |
"type": "image",
|
53 |
"image": img_path,
|
54 |
},
|
55 |
-
{"type": "text", "text": "Please help me write a prompt for image editing on this picture. The requirements are as follows: complex editing instructions should include two to
|
56 |
],
|
57 |
}
|
58 |
save_data.append(message)
|
59 |
|
60 |
print(len(save_data))
|
61 |
|
62 |
-
save_json = '/
|
63 |
write_json(save_json,save_data)
|
64 |
|
65 |
|
|
|
33 |
#print(data[0][2].keys())
|
34 |
|
35 |
file_path = '/home/zbz5349/WorkSpace/aigeeks/Qwen2.5-VL/magicbrush_dataset/data'
|
36 |
+
image_path = '/home/zbz5349/WorkSpace/aigeeks/Qwen2.5-VL/magicbrush_dataset/data'
|
37 |
os.makedirs(image_path,exist_ok=True)
|
38 |
|
39 |
save_data = []
|
|
|
42 |
print(sud_)
|
43 |
data = read_parquet(os.path.join(file_path,sud_))
|
44 |
for x in data:
|
45 |
+
img_path = os.path.join(image_path,x[2]['path'])
|
46 |
## 在 Linux 放开
|
47 |
slove_images(x[2]['bytes'],img_path)
|
48 |
message = {
|
|
|
52 |
"type": "image",
|
53 |
"image": img_path,
|
54 |
},
|
55 |
+
{"type": "text", "text": "Please help me write a prompt for image editing on this picture. The requirements are as follows: complex editing instructions should include two to four simple editing instructions involving spatial relationships (simple editing instructions such as ADD: add an object to the left of a certain object, DELETE: delete a certain object, MODIFY: change a certain object into another object). We hope that the editing instructions can have simple reasoning . Please give me clear editing instructions and also consider whether such editing instructions are reasonable.Examples are as follows:Removed railway signals closer to trains,Remove the person standing on the tracks and Change the red train into red train"},
|
56 |
],
|
57 |
}
|
58 |
save_data.append(message)
|
59 |
|
60 |
print(len(save_data))
|
61 |
|
62 |
+
save_json = '/Users/baixuehai/Downloads/2025_AAAI/dataset/prompt_1.json'
|
63 |
write_json(save_json,save_data)
|
64 |
|
65 |
|