MCPcopy Create free account
hub / github.com/THUDM/AgentTuning / ImageObservationProcessor

Class ImageObservationProcessor

eval_heldout/webarena/browser_env/processors.py:593–605  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

591
592
593class ImageObservationProcessor(ObservationProcessor):
594 def __init__(self, observation_type: str):
595 self.observation_type = observation_type
596 self.observation_tag = "image"
597 self.meta_data = create_empty_metadata()
598
599 def process(self, page: Page, client: CDPSession) -> npt.NDArray[np.uint8]:
600 try:
601 screenshot = png_bytes_to_numpy(page.screenshot())
602 except:
603 page.wait_for_event("load")
604 screenshot = png_bytes_to_numpy(page.screenshot())
605 return screenshot
606
607
608class ObservationHandler:

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected