Wendy-Fly commited on
Commit
9e1b812
·
verified ·
1 Parent(s): e4d8a51

Upload data.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. data.py +4 -4
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/images'
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(file_path,x[2]['path'])
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 five 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 and can also include some abstract concept-based editing (such as making the atmosphere more romantic, or making the diet healthier, or making the boy more handsome and the girl more beautiful, etc.). Please give me clear editing instructions and also consider whether such editing instructions are reasonable."},
56
  ],
57
  }
58
  save_data.append(message)
59
 
60
  print(len(save_data))
61
 
62
- save_json = '/home/zbz5349/WorkSpace/aigeeks/Qwen2.5-VL/magicbrush_dataset/dataset.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