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,9 +42,9 @@ 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(image_path,x[
|
46 |
## 在 Linux 放开
|
47 |
-
|
48 |
message = {
|
49 |
"role": "user",
|
50 |
"content": [
|
@@ -59,7 +59,7 @@ for sud_ in os.listdir(file_path):
|
|
59 |
|
60 |
print(len(save_data))
|
61 |
|
62 |
-
save_json = '/home/zbz5349/WorkSpace/aigeeks/Qwen2.5-VL/magicbrush_dataset/
|
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/images'
|
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[5]['path'])
|
46 |
## 在 Linux 放开
|
47 |
+
slove_images(x[5]['bytes'],img_path)
|
48 |
message = {
|
49 |
"role": "user",
|
50 |
"content": [
|
|
|
59 |
|
60 |
print(len(save_data))
|
61 |
|
62 |
+
save_json = '/home/zbz5349/WorkSpace/aigeeks/Qwen2.5-VL/magicbrush_dataset/tg_1.json'
|
63 |
write_json(save_json,save_data)
|
64 |
|
65 |
|