Download round0/wrapper/default_wrapper.py from YelinHe/behavior_2026_self_evaluation_simplify: direct link, hf CLI and curl.
- Browser
- Download file 1.19 kB
-
https://huggingface.co/datasets/YelinHe/behavior_2026_self_evaluation_simplify/resolve/main/round0/wrapper/default_wrapper.py
- Command line
-
hf download hf://datasets/YelinHe/behavior_2026_self_evaluation_simplify/round0/wrapper/default_wrapper.py
-
curl -L -o default_wrapper.py https://huggingface.co/datasets/YelinHe/behavior_2026_self_evaluation_simplify/resolve/main/round0/wrapper/default_wrapper.py
1.19 kB
| from omnigibson.envs import Environment, EnvironmentWrapper | |
| from omnigibson.eval.utils.eval_utils import EVAL_CAMERA_ROLES | |
| EVAL_LOW_RES = (224, 224) # (H, W) | |
| class DefaultWrapper(EnvironmentWrapper): | |
| """ | |
| Default eval wrapper: low-resolution (224x224) RGB observations. | |
| Camera resolution and modalities are declared via :meth:`camera_spec` and baked into the robot | |
| config at env CREATION by the BatchedEvaluator | |
| (see ``omnigibson.eval.evaluator.BatchedEvaluator.load_env``), | |
| not changed at runtime. This is required because in multi-env mode robot cameras are batched into | |
| a single ``TiledVisionSensor`` whose resolution is fixed at creation, so a post-hoc per-sensor | |
| resize would be silently ignored. | |
| Args: | |
| env (og.Environment): The environment to wrap. | |
| """ | |
| def camera_spec(cls) -> dict: | |
| """Returns {"modalities": [...], "resolution": {camera_role: (H, W)}} for this eval profile.""" | |
| return { | |
| "modalities": ["rgb"], | |
| "resolution": {role: EVAL_LOW_RES for role in EVAL_CAMERA_ROLES}, | |
| } | |
| def __init__(self, env: Environment): | |
| super().__init__(env=env) | |