MCPcopy Create free account
hub / github.com/RoboVerseOrg/RoboVerse / frame

Function frame

scripts/render_native_gallery.py:218–232  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

216 extra_ids = [lk.get_id() for lk in cab.get_links()] if cab is not None else []
217
218 def frame():
219 scene.update_render()
220 cam.take_picture()
221 color = cam.get_float_texture("Color")[..., :3]
222 raw = np.clip(color * 255, 0, 255).astype(np.uint8)
223 try:
224 seg = cam.get_uint32_texture("Segmentation")[..., 1]
225 fg = foreground_actor_ids(robot_ids, [o.get_id() for o in get_objs(env)], extra_ids)
226 ov = apply_greenscreen_overlay(color.astype(np.float64), seg, overlay, foreground_actor_ids=fg)
227 ovi = np.clip(ov * 255, 0, 255).astype(np.uint8)
228 except Exception:
229 ovi = raw
230 h = raw.shape[0]
231 bar = np.full((h, 4, 3), 255, np.uint8)
232 return np.concatenate([raw, bar, ovi], axis=1)
233
234 frames = [frame()]
235 for a in _scripted_actions():

Callers 1

run_taskFunction · 0.70

Calls 2

foreground_actor_idsFunction · 0.90

Tested by

no test coverage detected