Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
QuanyiLi committed Oct 24, 2023
1 parent 1f0da7f commit a4d454e
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ jobs:
pytest --cov=./ --cov-config=.coveragerc --cov-report=xml -sv tests/test_export_record_scenario
test_sensor_pipeline:
runs-on: ubuntu-latest
runs-on: [ubuntu-latest, gpu]
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
Expand Down
2 changes: 1 addition & 1 deletion metadrive/component/sensors/depth_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@ def _setup_effect(self):
LightAttrib.makeAllOff(), TextureAttrib.makeOff(), ColorAttrib.makeOff(),
ShaderAttrib.make(custom_shader, 1)
)
)
)
2 changes: 1 addition & 1 deletion metadrive/component/sensors/rgb_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ def _setup_effect(self):
)
self.tonemap_quad.set_shader(tonemap_shader)
self.tonemap_quad.set_shader_input('tex', self.scene_tex)
self.tonemap_quad.set_shader_input('exposure', 1.0)
self.tonemap_quad.set_shader_input('exposure', 1.0)
16 changes: 8 additions & 8 deletions metadrive/engine/core/image_buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ class ImageBuffer:
frame_buffer_rgb_bits = (8, 8, 8, 0)

def __init__(
self,
width: float,
height: float,
pos: Vec3,
bkg_color: Union[Vec4, Vec3],
parent_node: NodePath = None,
frame_buffer_property=None,
engine=None
self,
width: float,
height: float,
pos: Vec3,
bkg_color: Union[Vec4, Vec3],
parent_node: NodePath = None,
frame_buffer_property=None,
engine=None
):
self.logger = get_logger()
self._node_path_list = []
Expand Down
2 changes: 1 addition & 1 deletion metadrive/envs/base_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def _post_process_config(self, config):
if not config["render_pipeline"]:
for panel in config["interface_panel"]:
if panel == "dashboard":
config["sensors"]["dashboard"] = (DashBoard,)
config["sensors"]["dashboard"] = (DashBoard, )
if panel not in config["sensors"]:
self.logger.warning(
"Fail to add sensor: {} to the interface. Remove it from panel list!".format(panel)
Expand Down
2 changes: 1 addition & 1 deletion metadrive/obs/image_obs.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def observation_space(self):
assert issubclass(sensor_cls, BaseCamera), "Sensor should be subclass of BaseCamera"
channel = sum([1 if bit > 0 else 0 for bit in sensor_cls.frame_buffer_rgb_bits])
shape = (self.config["sensors"][self.image_source][2], self.config["sensors"][self.image_source][1]
) + ((self.STACK_SIZE,) if self.config["rgb_to_grayscale"] else (channel, self.STACK_SIZE))
) + ((self.STACK_SIZE, ) if self.config["rgb_to_grayscale"] else (channel, self.STACK_SIZE))
if self.rgb_clip:
return gym.spaces.Box(-0.0, 1.0, shape=shape, dtype=np.float32)
else:
Expand Down

0 comments on commit a4d454e

Please sign in to comment.