yfan1997 commited on
Commit
aa83e6f
·
verified ·
1 Parent(s): 0828e21

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +37 -0
README.md ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Dataset for Aerial Vision-and-Dialog Navigation (AVDN)
2
+
3
+
4
+ ```
5
+ import pandas as pd
6
+ import json
7
+ # Process each CSV file split
8
+ for split in ['train', 'val_seen', 'val_unseen', 'test_unseen']:
9
+ # Load the CSV data
10
+ df = pd.read_csv(f'./{split}_full_data.csv')
11
+
12
+ # Initialize a list to hold JSON data
13
+ json_data = []
14
+
15
+ # Convert each row in the DataFrame back to a dictionary (similar to JSON structure)
16
+ for _, row in df.iterrows():
17
+ entry = {
18
+ 'pre_dialogs': [],
19
+ 'map_name': row['map_name'],
20
+ 'route_index': row['route_index'],
21
+ 'instructions': row['instructions'],
22
+ 'gps_botm_left': json.loads(row['gps_botm_left']) if isinstance(row['gps_botm_left'], str) else row['gps_botm_left'],
23
+ 'gps_top_right': json.loads(row['gps_top_right']) if isinstance(row['gps_top_right'], str) else row['gps_top_right'],
24
+ 'lng_ratio': float(row['lng_ratio']),
25
+ 'lat_ratio': float(row['lat_ratio']),
26
+ 'angle': row['angle'],
27
+ 'destination': json.loads(row['destination']) if isinstance(row['destination'], str) else row['destination'],
28
+ 'attention_list': json.loads(row['attention_list']) if isinstance(row['attention_list'], str) else row['attention_list'],
29
+ 'gt_path_corners': json.loads(row['gt_path_corners']) if isinstance(row['gt_path_corners'], str) else row['gt_path_corners']
30
+ }
31
+ json_data.append(entry)
32
+
33
+ # Save the data to a JSON file
34
+ json_output_path = f'./{split}_full_data_from_csv_test.json'
35
+ with open(json_output_path, 'w') as f:
36
+ json.dump(json_data, f, indent=4)
37
+ ```