File tree Expand file tree Collapse file tree 2 files changed +24
-6
lines changed Expand file tree Collapse file tree 2 files changed +24
-6
lines changed Original file line number Diff line number Diff line change @@ -185,6 +185,12 @@ def main():
185
185
default = 1366 ,
186
186
help = "Width of screenshot image after processor rescaling" ,
187
187
)
188
+ parser .add_argument (
189
+ "--grounding_model_resize_height" ,
190
+ type = int ,
191
+ default = None ,
192
+ help = "Height of screenshot image after processor rescaling" ,
193
+ )
188
194
189
195
# Grounding model config option 2: Self-hosted endpoint based
190
196
parser .add_argument (
@@ -240,13 +246,16 @@ def main():
240
246
"api_key" : args .endpoint_api_key ,
241
247
}
242
248
else :
249
+ grounding_height = args .grounding_model_resize_height
250
+ # If not provided, use the aspect ratio of the screen to compute the height
251
+ if grounding_height is None :
252
+ grounding_height = screen_height * args .grounding_model_resize_width / screen_width
253
+
243
254
engine_params_for_grounding = {
244
255
"engine_type" : args .grounding_model_provider ,
245
256
"model" : args .grounding_model ,
246
257
"grounding_width" : args .grounding_model_resize_width ,
247
- "grounding_height" : screen_height
248
- * args .grounding_model_resize_width
249
- / screen_width ,
258
+ "grounding_height" : grounding_height ,
250
259
}
251
260
252
261
grounding_agent = OSWorldACI (
Original file line number Diff line number Diff line change @@ -133,6 +133,12 @@ def config() -> argparse.Namespace:
133
133
default = 1366 ,
134
134
help = "Width of screenshot image after processor rescaling" ,
135
135
)
136
+ parser .add_argument (
137
+ "--grounding_model_resize_height" ,
138
+ type = int ,
139
+ default = None ,
140
+ help = "Height of screenshot image after processor rescaling" ,
141
+ )
136
142
137
143
# Configuration 2
138
144
parser .add_argument ("--endpoint_provider" , type = str , default = "" )
@@ -190,13 +196,16 @@ def test(args: argparse.Namespace, test_all_meta: dict) -> None:
190
196
"api_key" : args .endpoint_api_key ,
191
197
}
192
198
else :
199
+ grounding_height = args .grounding_model_resize_height
200
+ # If not provided, use the aspect ratio of the screen to compute the height
201
+ if grounding_height is None :
202
+ grounding_height = args .screen_height * args .grounding_model_resize_width / args .screen_width
203
+
193
204
engine_params_for_grounding = {
194
205
"engine_type" : args .grounding_model_provider ,
195
206
"model" : args .grounding_model ,
196
207
"grounding_width" : args .grounding_model_resize_width ,
197
- "grounding_height" : args .screen_height
198
- * args .grounding_model_resize_width
199
- / args .screen_width ,
208
+ "grounding_height" : grounding_height ,
200
209
}
201
210
202
211
# NEW!
You can’t perform that action at this time.
0 commit comments