vita-epfl / RRB

Official implementation of "Injecting Knowledge in Data-driven Vehicle Trajectory Predictors", Published in Transportation research part C.
BSD 2-Clause "Simplified" License
67 stars 11 forks source link

How are the .txt files in trajnetbaselines/center_lines produced? #3

Closed ningwak closed 3 years ago

ningwak commented 3 years ago

I didn't find them in the downloaded Interaction Dataset.

MohammadHossein-Bahari commented 3 years ago

Hello, First, note that the Interaction dataset provides lanes' information in "osm" format, but we could not leverage them. The reason was that they provide lanes of the road, while we require centerlines, the center of the road that vehicles usually follow (some other datasets like Argoverse include centerline information). Anyway, as the conversion from what they provide to centerline is an error-prone engineering task (may not seems so, but is not easy at all :) ), we extracted these .txt files ourselves, by running clustering algorithms on the trajectory data and then averaging each cluster. Let me know if you have further questions.

ningwak commented 3 years ago

Thank you very much! Is the clustering converter included in the repository? In fact I am trying to apply the model learned from Interaction Dataset to another simulation environment so I need to understand how these .txt files are structured to poduce them acorrding to the road layout of that environment. However, when I downloaded and opened the .txt files I found them garbled while it didn't raise error when I ran the training and evaluation.

MohammadHossein-Bahari commented 3 years ago

No, it's not included. The files are in pickle format. To load it, use the following code (written here) :

with open("file_address" + ".txt" , "rb") as fp:
     array = pickle.load(fp) 

The format is [num_lanes, 2, num_points] where 2 is for x,y. So, if a scene has 4 lanes and the maximum number of points for lanes is 1000, the dimension is [4,2,1000].

ningwak commented 3 years ago

I tried to print the loaded file, but it seem to have more dimensions than you said. I am still a bit confused about what each dimension means.[

微信图片_20210623102341

](url)

ningwak commented 3 years ago

And how are the segmented images produced?

MohammadHossein-Bahari commented 3 years ago

The format is the same as what I mentioned before. For example, the file you showed here, "DR_USA_Intersection_GL.txt", has an array of [38, 2, 1806]. So it includes 38 lanes, and each lane has 1806 points.

Regarding your second question, the segmented images are produced using labelbox tool manually.

ningwak commented 3 years ago

Now I am trying to define my own scenerio and vehicle paths. I noticed inside "segmentedImgs" folder there is a file named offset.txt and I am wondering what "offset" means here and how to define the two offset values for a scenerio.

MohammadHossein-Bahari commented 3 years ago

Sorry for my late reply. I'm glad that you are progressing on your own data! The "offset" and "scale" values are there to convert vehicle positions (which are x,y global coordinates) to the pixel domain of the scene image. I required this conversion to be able to normalize scene images according to the location of the main agent. Then, I convert values back to the global coordinate.

ningwak commented 3 years ago

Thank you very much for your reply! So are the (x, y) positions printed above after being loaded from the .txt files in global coordinates or the pixel domain?

MohammadHossein-Bahari commented 3 years ago

Following my previous answer, the conversion from the global domain to the pixel domain is done here. Regarding your question, the centerlines in the .txt files are in the pixel domain.

ningwak commented 3 years ago

After the conversion are the positions converted to the pixel domain in normalized coordinates? If so, how can they correspond to the center lines which from my understanding are in pixel domain and global coordinates?

MohammadHossein-Bahari commented 3 years ago

After conversion, the positions are in the pixel domain. Then, we normalize them based on the position and direction of ego-vehicle here. The centerlines are normalized in the next line of code here. So, we have first the positions and centerlines in the pixel domain, then normalize them.

swb19 commented 3 years ago

Thank you very much! Is the clustering converter included in the repository? In fact I am trying to apply the model learned from Interaction Dataset to another simulation environment so I need to understand how these .txt files are structured to poduce them acorrding to the road layout of that environment. However, when I downloaded and opened the .txt files I found them garbled while it didn't raise error when I ran the training and evaluation.

hello, could you please tell me where I downloaded these .txt files?

ningwak commented 3 years ago

Thank you very much! Is the clustering converter included in the repository? In fact I am trying to apply the model learned from Interaction Dataset to another simulation environment so I need to understand how these .txt files are structured to poduce them acorrding to the road layout of that environment. However, when I downloaded and opened the .txt files I found them garbled while it didn't raise error when I ran the training and evaluation.

hello, could you please tell me where I downloaded these .txt files?

They are inside this folder. https://github.com/vita-epfl/RRB/tree/main/trajnetbaselines/center_lines

swb19 commented 3 years ago

Thank you very much! Is the clustering converter included in the repository? In fact I am trying to apply the model learned from Interaction Dataset to another simulation environment so I need to understand how these .txt files are structured to poduce them acorrding to the road layout of that environment. However, when I downloaded and opened the .txt files I found them garbled while it didn't raise error when I ran the training and evaluation.

hello, could you please tell me where I downloaded these .txt files?

They are inside this folder. https://github.com/vita-epfl/RRB/tree/main/trajnetbaselines/center_lines

Thank you very much! I have found them! But I have another question, in the trajnetdataset/trajnetdataset/convert.py, some other.txt files are required for train_data, such as 'DJI_0001-Roseville-annot1Point.txt', do you know how to find them?

MohammadHossein-Bahari commented 3 years ago

Thank you very much! Is the clustering converter included in the repository? In fact I am trying to apply the model learned from Interaction Dataset to another simulation environment so I need to understand how these .txt files are structured to poduce them acorrding to the road layout of that environment. However, when I downloaded and opened the .txt files I found them garbled while it didn't raise error when I ran the training and evaluation.

hello, could you please tell me where I downloaded these .txt files?

They are inside this folder. https://github.com/vita-epfl/RRB/tree/main/trajnetbaselines/center_lines

Thank you very much! I have found them! But I have another question, in the trajnetdataset/trajnetdataset/convert.py, some other.txt files are required for train_data, such as 'DJI_0001-Roseville-annot1Point.txt', do you know how to find them?

The convert.py file processes the annotation txt files provided by the dataset. I have uploaded the processed files in RRB/trajnetdataset/outputinteraction* folders. You do not need to run the convert.py file.