-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add map root path when visualizing data #285
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 | ||
|
@@ -14,6 +15,7 @@ | |
|
||
_ZORDER = {"AGENT": 15, "AV": 10, "OTHERS": 5} | ||
|
||
_PathLike = Union[str, "os.PathLike[str]", None] | ||
|
||
def interpolate_polyline(polyline: np.ndarray, num_points: int) -> np.ndarray: | ||
duplicates = [] | ||
|
@@ -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, | ||
|
@@ -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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the default in avm = ArgoverseMap(map_root) Either way... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you do not pass the Related Links: |
||
else: | ||
avm = ArgoverseMap() | ||
seq_lane_props = avm.city_lane_centerlines_dict[city_name] | ||
|
||
plt.figure(0, figsize=(8, 7)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this would be more natural as:
Then it is up to a user to use an
Optional[_PathLike]
if theNone
is permissable.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mgilson-argo Thank you for your review, and I modified the PathLike expression based on your advice.