本文整理匯總了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