lingbot-sn80-workspace / 1gpu /eval /dump_render.py
salpu's picture
1-GPU box: eval harness wired+corrected, LoRA export merge fix, utilisation profiling, findings
3922a1b verified
Raw History Blame Contribute Delete
696 Bytes
import sys, numpy as np
sys.path.insert(0, "/app/third_party/libero")
from libero.libero import benchmark, get_libero_path
from libero.libero.envs import OffScreenRenderEnv
import imageio
bm = benchmark.get_benchmark_dict()["libero_spatial"]()
task = bm.get_task(0)
bddl = get_libero_path("bddl_files") + "/" + task.problem_folder + "/" + task.bddl_file
env = OffScreenRenderEnv(bddl_file_name=bddl, camera_heights=256, camera_widths=256)
obs = env.reset()
img = obs["agentview_image"]
imageio.imwrite("/out/render_raw.png", img)
imageio.imwrite("/out/render_rot180.png", np.ascontiguousarray(img[::-1, ::-1]))
print("saved. raw top/bottom mean:", img[:128].mean(), img[128:].mean())
env.close()