mirror of
https://github.com/SikongJueluo/Mini-Nav.git
synced 2026-07-12 20:15:31 +08:00
feat(pipeline): add batch processing for scene graph construction
This commit is contained in:
@@ -30,6 +30,7 @@ def render_topdown_scene_map(
|
||||
style: TopDownRenderStyle | None = None,
|
||||
maps_module: Any | None = None,
|
||||
plt_module: Any | None = None,
|
||||
use_matplotlib: bool = True,
|
||||
) -> Any:
|
||||
if not elements.room_nodes:
|
||||
raise ValueError("room_nodes must not be empty")
|
||||
@@ -49,9 +50,6 @@ def render_topdown_scene_map(
|
||||
if maps_module is None:
|
||||
maps_module = import_module("habitat.utils.visualizations.maps")
|
||||
|
||||
if plt_module is None:
|
||||
plt_module = import_module("matplotlib.pyplot")
|
||||
|
||||
map_height = float(elements.room_nodes[0].center[1])
|
||||
top_down_map = maps_module.get_topdown_map(
|
||||
pathfinder,
|
||||
@@ -59,6 +57,15 @@ def render_topdown_scene_map(
|
||||
meters_per_pixel=meters_per_pixel,
|
||||
)
|
||||
|
||||
if not use_matplotlib:
|
||||
return top_down_map
|
||||
|
||||
if plt_module is None:
|
||||
try:
|
||||
plt_module = import_module("matplotlib.pyplot")
|
||||
except ImportError:
|
||||
return top_down_map
|
||||
|
||||
plt_module.figure(figsize=style.figure_size)
|
||||
plt_module.imshow(top_down_map, cmap=style.map_cmap)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user