本文整理汇总了Python中render.swiftshader_renderer.SwiftshaderRenderer方法的典型用法代码示例。如果您正苦于以下问题:Python swiftshader_renderer.SwiftshaderRenderer方法的具体用法?Python swiftshader_renderer.SwiftshaderRenderer怎么用?Python swiftshader_renderer.SwiftshaderRenderer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类render.swiftshader_renderer
的用法示例。
在下文中一共展示了swiftshader_renderer.SwiftshaderRenderer方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: load_building
# 需要导入模块: from render import swiftshader_renderer [as 别名]
# 或者: from render.swiftshader_renderer import SwiftshaderRenderer [as 别名]
def load_building(dataset_name, building_name):
dataset = factory.get_dataset(dataset_name)
navtask = get_args()
cp = navtask.camera_param
rgb_shader, d_shader = renderer.get_shaders(cp.modalities)
r_obj = SwiftshaderRenderer()
r_obj.init_display(width=cp.width, height=cp.height,
fov=cp.fov, z_near=cp.z_near, z_far=cp.z_far,
rgb_shader=rgb_shader, d_shader=d_shader)
r_obj.clear_scene()
b = VisualNavigationEnv(robot=navtask.robot, env=navtask.env,
task_params=navtask.task_params,
building_name=building_name, flip=False,
logdir=None, building_loader=dataset,
r_obj=r_obj)
b.load_building_into_scene()
b.set_building_visibility(False)
return b
示例2: set_r_obj
# 需要导入模块: from render import swiftshader_renderer [as 别名]
# 或者: from render.swiftshader_renderer import SwiftshaderRenderer [as 别名]
def set_r_obj(self, r_obj):
"""Sets the SwiftshaderRenderer object used for rendering."""
self.r_obj = r_obj
示例3: _setup_mapper
# 需要导入模块: from render import swiftshader_renderer [as 别名]
# 或者: from render.swiftshader_renderer import SwiftshaderRenderer [as 别名]
def _setup_mapper(self):
# Set up the renderer.
cp = self.camera_param
rgb_shader, d_shader = sru.get_shaders(cp.modalities)
r_obj = SwiftshaderRenderer()
r_obj.init_display(width=cp.width, height=cp.height, fov=cp.fov,
z_near=cp.z_near, z_far=cp.z_far, rgb_shader=rgb_shader,
d_shader=d_shader)
self.r_obj = r_obj
r_obj.clear_scene()
# Load building env class.
self.buildings = []
wt = []
for i, building_name in enumerate(self.building_names):
b = self.env_class(robot=self.robot, env=self.env,
task_params=self.task_params,
building_name=building_name, flip=self.flip[i],
logdir=self.logdir, building_loader=self.dataset,
r_obj=r_obj)
wt.append(b.get_weight())
b.load_building_into_scene()
b.set_building_visibility(False)
self.buildings.append(b)
wt = np.array(wt).astype(np.float32)
wt = wt / np.sum(wt+0.0001)
self.building_sampling_weights = wt