Skip to content

Issue with adding SOM annotated image observation #23

@vardaan123

Description

@vardaan123

Hi, thanks for the great work! I have been working to add a SOM annotated image as additional observation input. I need to make sure that the accessibility/DOM tree and SOM element IDs are aligned. I have tried the following approaches:

  1. While constructing the DOM tree in build_dom_tree() https://github.com/iMeanAI/WebCanvas/blob/main/agent/Environment/html_env/build_tree.py#L207, I obtain the xpath of each element, get the playwright element using page.locator(xpath={}) and then obtain the bounding box of that element. However, it is very slow and inefficient. It takes ~10 mins to run it each time.
  2. I can get the bounding boxes of all elements using JS code (like in VisualWebArena https://github.com/web-arena-x/visualwebarena/blob/b56b6d821e0b0f926fb940a7efe7d3f1246eab36/browser_env/processors.py#L809) however, the IDs need to be mapped to the ones in your codebase for correspondence b/w element IDs in SOM and DOM tree. I tried to do the mapping using xpath but Mind2web-Live has a different xpath/selector format than that is available in standard playwright JS.

Kindly let me know if you have any suggestions to implement this. Eagerly Looking forward to your response!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions