Skip to content
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

Binary map mask api and visualization example #181

Merged
merged 29 commits into from
Jul 3, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
542a52f
rename map_graph to map_api
Jun 28, 2019
d807fca
wip: rendering
Jun 28, 2019
6511265
rendering
Jun 28, 2019
a9f1e87
map api done
Jun 28, 2019
1eb2081
visualization example
Jun 28, 2019
b0f2508
Renamed MapAPIExplorer to NuscenesMapExplorer
holger-motional Jul 1, 2019
355e4bb
Reformatting
holger-motional Jul 1, 2019
44da88b
Reformatting
Jul 1, 2019
677f150
Undo spacing bug
holger-motional Jul 1, 2019
9fe3e1d
Merge branch 'kiwoo_map' of github.com:nutonomy/nuscenes-devkit into …
holger-motional Jul 1, 2019
4e0c146
Fix missing return statement
holger-motional Jul 1, 2019
3b2c584
Added n_rows as argument
holger-motional Jul 1, 2019
d064f91
Pass on n_rows argument
holger-motional Jul 1, 2019
3fa9c2e
Improved tutorial visualization
Jul 1, 2019
40c8316
Updated naming conventions, first extract raw data then visualize, ch…
Jul 1, 2019
0608061
Rename `get_map_patch_mask` to `get_map_mask` and change output forma…
holger-motional Jul 1, 2019
dc5aa9c
Added instructions for rotated map patches
Jul 1, 2019
573d420
Updated typing
holger-motional Jul 1, 2019
dfd421b
Plot whole map by default
holger-motional Jul 1, 2019
49e76c1
Typo in the map names
holger-motional Jul 1, 2019
dda2ddc
Round canvas size
holger-motional Jul 1, 2019
536b536
Swapped order of arguments
holger-motional Jul 1, 2019
1db59ed
Handle case where canvas_size is not given to render_map_mask
holger-motional Jul 1, 2019
7da662b
Started on semantic prior check
Jul 1, 2019
dae08fe
Fixed bug with swapped height/width
holger-motional Jul 2, 2019
88d222b
Merge branch 'kiwoo_map' of github.com:nutonomy/nuscenes-devkit into …
holger-motional Jul 2, 2019
ac46697
More experiments on reconstructing semantic prior
Jul 2, 2019
bd1f078
Removing comparison to semantic_prior
Jul 3, 2019
fa9c686
Delete test.py
holger-motional Jul 3, 2019
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
26 changes: 25 additions & 1 deletion python-sdk/nuscenes/map_expansion/map_demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
"patch_angle = 0 # Default orientation where North is up\n",
"layer_names = ['drivable_area', 'ped_crossing']\n",
"canvas_size = (1000, 1000)\n",
"map_mask = nusc_map.explorer.get_map_mask(patch_box, patch_angle, layer_names, canvas_size)\n",
"map_mask = nusc_map.get_map_mask(patch_box, patch_angle, layer_names, canvas_size)\n",
"map_mask[0]"
]
},
Expand Down Expand Up @@ -166,6 +166,30 @@
"fig, ax = nusc_map.render_map_mask(patch_box, 45, layer_names, canvas_size, figsize=figsize, n_row=1)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In case you previously used the nuScenes v1.0 semantic prior map, here we show how to reconstruct that map given the nuScenes expansion pack:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"patch_box = None\n",
"patch_angle = 0 # Default orientation where North is up\n",
"layer_names = ['drivable_area', 'walkway']\n",
"canvas_size = None\n",
"map_mask = nusc_map.get_map_mask(patch_box, patch_angle, layer_names, canvas_size)\n",
"semantic_prior = np.any(map_mask, axis=0)\n",
"plt.imshow(semantic_prior, origin='lower')\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down
15 changes: 7 additions & 8 deletions python-sdk/nuscenes/map_expansion/test.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
from nuscenes.map_expansion.map_api import NuscenesMap
import matplotlib.pyplot as plt
import matplotlib.pyplot as plt

map_graph = NuscenesMap(dataroot='/data/sets/nuscenes', map_name='singapore-onenorth')
nusc_map = NuscenesMap(dataroot='/data/sets/nuscenes', map_name='singapore-onenorth')

patch_box = (400, 1500, 500, 500)
patch_angle = 0
layer_names = None
figsize = (40, 10)
canvas_size = (1000, 1000)
fig, ax = map_graph.render_map_mask(patch_box, patch_angle, layer_names, figsize, canvas_size)
patch_box = None
patch_angle = 0 # Default orientation where North is up
layer_names = ['drivable_area', 'ped_crossing']
canvas_size = None
map_mask = nusc_map.explorer.render_map_mask(patch_box, patch_angle, layer_names, canvas_size, figsize=(15, 15))