File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 55
66from agentlab .analyze import overlay_utils
77from agentlab .llm .llm_utils import img_to_base_64
8+ import numpy as np
89
910
1011def draw_mouse_pointer (image : Image .Image , x : int , y : int ) -> Image .Image :
@@ -135,7 +136,7 @@ def zoom_webpage(page: Page, zoom_factor: float = 1.5):
135136 return page
136137
137138
138- def overlay_action (obs , action ):
139+ def overlay_action (obs , action , return_array = False ):
139140 """Overlays actions on screenshot in-place"""
140141 act_img = copy .deepcopy (obs ["screenshot" ])
141142 act_img = Image .fromarray (act_img )
@@ -153,4 +154,7 @@ def overlay_action(obs, action):
153154 pass
154155
155156 overlay_utils .annotate_action (act_img , action , properties = new_obs_properties )
156- return img_to_base_64 (act_img )
157+ if return_array :
158+ return np .array (act_img )
159+ else :
160+ return img_to_base_64 (act_img )
You can’t perform that action at this time.
0 commit comments