SemSorter commited on
Commit
f1f9b36
·
1 Parent(s): c4b4cc0

Explicitly pass 960x540 resolution to render_frame calls to match MuJoCo framebuffer and prevent memory crash

Browse files
SemSorter/server/agent_bridge.py CHANGED
@@ -402,7 +402,7 @@ def render_frame(camera: str = "overview"):
402
  """
403
  with _sim_lock:
404
  sim = get_simulation()
405
- return sim.render_frame(camera=camera)
406
 
407
 
408
  def get_latest_frame_jpeg() -> Optional[bytes]:
 
402
  """
403
  with _sim_lock:
404
  sim = get_simulation()
405
+ return sim.render_frame(camera=camera, width=960, height=540)
406
 
407
 
408
  def get_latest_frame_jpeg() -> Optional[bytes]:
SemSorter/vision/vision_pipeline.py CHANGED
@@ -91,7 +91,7 @@ class HazardDetectionProcessor:
91
 
92
  def _capture_from_simulation(self) -> Image.Image:
93
  """Render a frame directly from the MuJoCo simulation."""
94
- frame = self.simulation.render_frame(camera="overview")
95
  return Image.fromarray(frame)
96
 
97
  def _capture_from_obs(self) -> Image.Image:
 
91
 
92
  def _capture_from_simulation(self) -> Image.Image:
93
  """Render a frame directly from the MuJoCo simulation."""
94
+ frame = self.simulation.render_frame(camera="overview", width=960, height=540)
95
  return Image.fromarray(frame)
96
 
97
  def _capture_from_obs(self) -> Image.Image: