Comments (5)
Hi @moonseokha,
Sorry for the late reply.
def plot_single_vehicle(
avm: ArgoverseMap,
sample_past_trajectory: np.ndarray, # (20, 2)
sample_groundtruth: np.ndarray, # (20, 2)
sample_forecasted_trajectories: List[np.ndarray], # List[(30, 2)]
sample_city_name: str,
ls: str):
sample_groundtruth = np.concatenate((np.expand_dims(sample_past_trajectory[-1], axis=0), sample_groundtruth), axis=0)
for sample_forecasted_trajectory in sample_forecasted_trajectories:
sample_forecasted_trajectory = np.concatenate((np.expand_dims(sample_past_trajectory[-1], axis=0), sample_forecasted_trajectory), axis=0)
## Plot history
obs_len = sample_past_trajectory.shape[0]
pred_len = sample_groundtruth.shape[0]
plt.plot(
sample_past_trajectory[:, 0],
sample_past_trajectory[:, 1],
color="#ECA154",
label="Past Trajectory",
alpha=1,
linewidth=3,
zorder=15,
ls = ls
)
## Plot future
plt.plot(
sample_groundtruth[:, 0],
sample_groundtruth[:, 1],
color="#d33e4c",
label="Ground Truth",
alpha=1,
linewidth=3.0,
zorder=20,
ls = "--"
)
## Plot prediction
for j in range(len(sample_forecasted_trajectories)):
plt.plot(
sample_forecasted_trajectories[j][:, 0],
sample_forecasted_trajectories[j][:, 1],
color="#007672",
label="Forecasted Trajectory",
alpha=1,
linewidth=3.2,
zorder=15,
ls = "--"
)
# Plot the end marker for forcasted trajectories
plt.arrow(
sample_forecasted_trajectories[j][-2, 0],
sample_forecasted_trajectories[j][-2, 1],
sample_forecasted_trajectories[j][-1, 0] - sample_forecasted_trajectories[j][-2, 0],
sample_forecasted_trajectories[j][-1, 1] - sample_forecasted_trajectories[j][-2, 1],
color="#007672",
label="Forecasted Trajectory",
alpha=1,
linewidth=3.2,
zorder=15,
head_width=1.1,
)
## Plot the end marker for history
plt.arrow(
sample_past_trajectory[-2, 0],
sample_past_trajectory[-2, 1],
sample_past_trajectory[-1, 0] - sample_past_trajectory[-2, 0],
sample_past_trajectory[-1, 1] - sample_past_trajectory[-2, 1],
color="#ECA154",
label="Past Trajectory",
alpha=1,
linewidth=3,
zorder=25,
head_width=1.0,
)
## Plot the end marker for future
plt.arrow(
sample_groundtruth[-2, 0],
sample_groundtruth[-2, 1],
sample_groundtruth[-1, 0] - sample_groundtruth[-2, 0],
sample_groundtruth[-1, 1] - sample_groundtruth[-2, 1],
color="#d33e4c",
label="Ground Truth",
alpha=1,
linewidth=3.0,
zorder=25,
head_width=1.0,
)
## Plot history context
for j in range(obs_len):
lane_ids = avm.get_lane_ids_in_xy_bbox(
sample_past_trajectory[j, 0],
sample_past_trajectory[j, 1],
sample_city_name,
query_search_range_manhattan=65,
)
[avm.draw_lane(lane_id, sample_city_name) for lane_id in lane_ids]
## Plot future context
for j in range(pred_len):
lane_ids = avm.get_lane_ids_in_xy_bbox(
sample_groundtruth[j, 0],
sample_groundtruth[j, 1],
sample_city_name,
query_search_range_manhattan=65,
)
[avm.draw_lane(lane_id, sample_city_name) for lane_id in lane_ids]
from hivt.
Thank you for reply and good code. :)
Hi,
Could you please release the complete visualization code? Thanks a lot.
from hivt.
Thank you for reply and good code. :)
from hivt.
Hi, i've seen the code and i want to know how to get those samples in the code below
def plot_single_vehicle(
avm: ArgoverseMap,
sample_past_trajectory: np.ndarray, # (20, 2)
sample_groundtruth: np.ndarray, # (20, 2)
sample_forecasted_trajectories: List[np.ndarray], # List[(30, 2)]
sample_city_name: str,
ls: str):
there is no code generating sample_past_trajectory, sample_groundtruth, sample_forecasted_trajectories
in HiVT repository so i cant run that code.
any help and suggestions will be helping my project alot.
Thanks :)
from hivt.
Hi, have you solved this problem? Thank you!
@Joonki0111 @xinfu607 @moonseokha @ZikangZhou
Hi, i've seen the code and i want to know how to get those samples in the code below
def plot_single_vehicle( avm: ArgoverseMap, sample_past_trajectory: np.ndarray, # (20, 2) sample_groundtruth: np.ndarray, # (20, 2) sample_forecasted_trajectories: List[np.ndarray], # List[(30, 2)] sample_city_name: str, ls: str):
there is no code generating sample_past_trajectory, sample_groundtruth, sample_forecasted_trajectories in HiVT repository so i cant run that code.
any help and suggestions will be helping my project alot. Thanks :)
from hivt.
Related Issues (20)
- Why Euclidean distance needed to be conculated after Huffman Distance? HOT 6
- Question: where do you make the scene centered at separate agents in code? HOT 4
- A question about AAEncoder HOT 1
- Qualitative Results Visualization HOT 5
- Test set performance HOT 17
- What do "semantic attributes" represent? HOT 1
- torch.load bottleneck? HOT 1
- Prediction Results for non-agent objects HOT 6
- Code for Qualitative Results analysis HOT 1
- About the loss: reg loss and cls loss HOT 3
- How to obtain the ADE/FDE/MR result of test set? HOT 4
- About no requirements.txt HOT 1
- Code Question HOT 1
- 评价指标报错 HOT 5
- about how to generate test result HOT 2
- The meaning about bos_mask HOT 1
- Bit-wise NOT operation "~" for padding_mask in data.
- What does 'parallel' in args mean?
- HiVT map-free customization HOT 1
- "solving environment killed" while "conda install pytorch-lightning==1.5.2 -c conda-forge"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hivt.