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

Class ImageObservationProcessor

webarena/browser_env/processors.py:811–823  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

809
810
811class ImageObservationProcessor(ObservationProcessor):
812 def __init__(self, observation_type: str):
813 self.observation_type = observation_type
814 self.observation_tag = "image"
815 self.meta_data = create_empty_metadata()
816
817 def process(self, page: Page, client: CDPSession, context: str) -> npt.NDArray[np.uint8]:
818 try:
819 screenshot = png_bytes_to_numpy(page.screenshot())
820 except:
821 page.wait_for_event("load")
822 screenshot = png_bytes_to_numpy(page.screenshot())
823 return screenshot
824
825
826class ObservationHandler:

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected