Skip to content

fix: correct midpoint calculation in convert_point_to_coordinates#243

Open
kuishou68 wants to merge 1 commit into
bytedance:mainfrom
kuishou68:fix/issue-242-point-coordinates
Open

fix: correct midpoint calculation in convert_point_to_coordinates#243
kuishou68 wants to merge 1 commit into
bytedance:mainfrom
kuishou68:fix/issue-242-point-coordinates

Conversation

@kuishou68
Copy link
Copy Markdown

Closes #242

Problem

In codes/ui_tars/action_parser.py, the convert_point_to_coordinates function incorrectly computes the center of a point using x1+x1 and y1+y1 instead of x1+x2 and y1+y2. This copy-paste error causes the function to always return the top-left corner (x1, y1) of the bounding box instead of its actual center.

# BUG (before)
x = (x1 + x1) // 2
y = (y1 + y1) // 2

# FIX (after)
x = (x1 + x2) // 2
y = (y1 + y2) // 2

Impact

All point-to-coordinate conversions silently return the wrong location, leading to incorrect click/interaction targets in the UI agent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: convert_point_to_coordinates computes x and y from x1+x1 instead of x1+x2

1 participant