Skip to content

Commit b98934b

Browse files
authored
fix: align osworld_g polygon scoring with osworld-verified annotations (#1165)
1 parent 18f2cc1 commit b98934b

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

docs/current_tasks.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,7 @@ python -m lmms_eval --tasks list_with_num
490490

491491
### Referring Expression Comprehension
492492
- [Ferret](https://github.com/apple/ml-ferret) (ferret)
493+
- [OSWorld-Verified (OSWorld-G)](https://xlang.ai/blog/osworld-verified) (osworld_g)
493494
- [RefCOCO](https://github.com/lichengunc/refer) (refcoco)
494495
- refcoco_seg_test, refcoco_seg_val
495496
- refcoco_seg_testA, refcoco_seg_testB

lmms_eval/tasks/osworld_g/utils.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,17 @@ def _point_in_bbox(point_xy: Tuple[float, float], bbox_xywh: List[float]) -> boo
8383

8484
def _point_in_polygon(point_xy: Tuple[float, float], polygon: List[float]) -> bool:
8585
x, y = point_xy
86+
if len(polygon) == 4:
87+
left, top, right, bottom = polygon
88+
if left > right:
89+
left, right = right, left
90+
if top > bottom:
91+
top, bottom = bottom, top
92+
return left <= x <= right and top <= y <= bottom
93+
94+
if len(polygon) % 2 != 0:
95+
return False
96+
8697
n = len(polygon) // 2
8798
if n < 3:
8899
return False

0 commit comments

Comments
 (0)