exiawsh commited on
Commit
71be7bc
·
verified ·
1 Parent(s): dc20f3b

Upload 4 files

Browse files
.gitattributes CHANGED
@@ -70,3 +70,5 @@ split_jsonl_multi_turn/ssv2.jsonl filter=lfs diff=lfs merge=lfs -text
70
  split_jsonl_multi_turn/tgif_frame_qa.jsonl filter=lfs diff=lfs merge=lfs -text
71
  split_jsonl_multi_turn/tgif_transition_qa.jsonl filter=lfs diff=lfs merge=lfs -text
72
  split_jsonl_multi_turn/videochat2.jsonl filter=lfs diff=lfs merge=lfs -text
 
 
 
70
  split_jsonl_multi_turn/tgif_frame_qa.jsonl filter=lfs diff=lfs merge=lfs -text
71
  split_jsonl_multi_turn/tgif_transition_qa.jsonl filter=lfs diff=lfs merge=lfs -text
72
  split_jsonl_multi_turn/videochat2.jsonl filter=lfs diff=lfs merge=lfs -text
73
+ filtered_train_llama_extrav3.json filter=lfs diff=lfs merge=lfs -text
74
+ test_drivelm.json filter=lfs diff=lfs merge=lfs -text
convert_drivelm.py ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+ import re
3
+ import pickle
4
+ import numpy as np
5
+
6
+ def get_image_qa(json_path):
7
+ image_qa = dict()
8
+ with open(json_path, 'r') as f:
9
+ data = json.load(f)
10
+ for item in data:
11
+ image_qa['./' + item['image'][0]+ '_' +item['id']] = item
12
+ return image_qa
13
+
14
+ def read_pkl_file(file_path):
15
+ try:
16
+ with open(file_path, 'rb') as file:
17
+ data = pickle.load(file)
18
+ return data
19
+ except FileNotFoundError:
20
+ print(f"错误:文件 '{file_path}' 不存在。")
21
+ except pickle.UnpicklingError:
22
+ print(f"错误:无法解析文件 '{file_path}'。可能不是有效的 Pickle 文件。")
23
+ except Exception as e:
24
+ print(f"读取文件时发生错误:{str(e)}")
25
+ return None
26
+
27
+ file_path = 'nuscenes2d_ego_temporal_infos_val.pkl'
28
+ data = read_pkl_file(file_path)
29
+
30
+ pkl_info = dict()
31
+ for info in data['infos']:
32
+ pkl_info[info['cams']['CAM_FRONT']['data_path']] = info
33
+
34
+ qa_pairs = get_image_qa('test_drivelm.json')
35
+
36
+ new_pkl = []
37
+ for qa in qa_pairs:
38
+ match = re.match(r"(.*\.jpg)", qa)
39
+ if match:
40
+ result = match.group(1)
41
+ pkl_info[result]['qa'] = qa_pairs[qa]
42
+ new_pkl.append(pkl_info[result])
43
+ data['infos'] = new_pkl
44
+ with open('drivelm_test.pkl', 'wb') as file:
45
+ pickle.dump(data, file)
filtered_train_llama_extrav3.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:52b7526374ea3dc4bb72660e511f24c710ef0cc549cc39c82a1e4f0dfe30b103
3
+ size 113902981
projects.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c7ae3c8f4a143dd509b9592d531c6a5dfd61c242ade229d41d819b5c37fed8ea
3
+ size 354496
test_drivelm.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cd5f644c874640ca488ff986ec08a66eef160d786d210fb28e12c9eb8cf9f47d
3
+ size 18218754