Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions argoverse/visualization/visualize_sequences.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env python

"""A simple python script template."""
import os
from collections import defaultdict
from typing import Dict, List, Optional
from typing import Dict, List, Optional, Union

import matplotlib.lines as mlines
import matplotlib.pyplot as plt
Expand All @@ -14,6 +15,7 @@

_ZORDER = {"AGENT": 15, "AV": 10, "OTHERS": 5}

_PathLike = Union[str, "os.PathLike[str]"]

def interpolate_polyline(polyline: np.ndarray, num_points: int) -> np.ndarray:
duplicates = []
Expand All @@ -31,6 +33,7 @@ def interpolate_polyline(polyline: np.ndarray, num_points: int) -> np.ndarray:

def viz_sequence(
df: pd.DataFrame,
map_root: _PathLike = None,
lane_centerlines: Optional[List[np.ndarray]] = None,
show: bool = True,
smoothen: bool = False,
Expand All @@ -41,7 +44,10 @@ def viz_sequence(

if lane_centerlines is None:
# Get API for Argo Dataset map
avm = ArgoverseMap()
if map_root is not None:
avm = ArgoverseMap(map_root)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the default in ArgoverseMap if map_root isn't passed? I would have expected it to just be None anyway. If that's the case, you could just do:

avm = ArgoverseMap(map_root)

Either way...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you do not pass the map_root to ArogverseMap, it would be ROOT=Path(__file__).resolve().parent.parent.parent / "map_files".

Related Links:

else:
avm = ArgoverseMap()
seq_lane_props = avm.city_lane_centerlines_dict[city_name]

plt.figure(0, figsize=(8, 7))
Expand Down