Haoran-SONG / PiP-Planning-informed-Prediction

(ECCV 2020) PiP: Planning-informed Trajectory Prediction for Autonomous Driving
http://song-haoran.com/planning-informed-prediction/
176 stars 45 forks source link

About Preprocessing HighD Dataset #6

Closed Bowie-Z closed 2 years ago

Bowie-Z commented 3 years ago

Thank you for providing source code of your brilliant work on vehicle trajectory prediction. I have 2 questions about HighD dataset using in your work:

  1. In the file 'preprocess_highD.m', the length of past trajectory is 30 frames and that of future trajectory is 50 frames, which is the same to your implementation in 'preprocess_ngsim.m'. However, as far as I know, the sampling rate of HighD dataset is 25Hz and is different from the sampling rate of NGSIM dataset, which is 10Hz. Could you please share the details about dealing with such problem?
  2. It would be very kind of you if the source code on plotting the figures in your paper will be shared.
Haoran-SONG commented 3 years ago

For convenience, I preprocessed the highD dataset to make it with the same format as NGSIM. Downsampling (25Hz ->10Hz) is made by simple interpolation. I just uploaded it to the highD-ngsim-format folder for your reference. Actually, I only use 5Hz in the network, so it's easier to directly downsample both datasets (25/10Hz) to 5Hz.

Another author helped with visualizing the results, so I didn't take the time to polish that part. I guess your interest lies in the colorline in my trajectory visualization? Here I provide the code snippet which you may require:

import matplotlib.pyplot as plt
import matplotlib.collections as mcoll
def colorline(self, x, y, ax,
                z=None, cmap=plt.get_cmap('rainbow'), norm=plt.Normalize(0.0, 1.0), linewidth=4, alpha=0.9, zorder=3):
      """
      http://nbviewer.ipython.org/github/dpsanders/matplotlib-examples/blob/master/colorline.ipynb
      http://matplotlib.org/examples/pylab_examples/multicolored_line.html
      Plot a colored line with coordinates x and y
      Optionally specify colors in the array z
      Optionally specify a colormap, a norm function and a line width
      """
      # Default colors equally spaced on [0,1]:
      if z is None:
          z = np.linspace(0.0, 1.0, len(x))
      z = np.asarray(z)
      segments = self.make_segments(x, y)
      lc = mcoll.LineCollection(segments, array=z, cmap=cmap, norm=norm, zorder= zorder,
                                linewidth=linewidth, alpha=alpha)
      ax.add_collection(lc)
      return lc
vinit-katariya commented 2 years ago

@Haoran-SONG Thank you for providing the repo. of your insightful work.

The folder link highD-ngsim-format folder provides HighD Dataset in NGSIM format. You have divided each track the HighD dataset into fwd and bck based on direction of motion mentioned in xx_trackMeta file.

Can you please share the source code used to convert the HighD dataset into NGSIM format in the reply or at vinit.katariya99@gmail.com?