bytedance / bytedance/UI-TARS

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

Open Beginner friendly
#242 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
11.5k
Forks
877
PR merge metrics
No merged PRs in 30d

Description

## Bug

In `codes/ui_tars/action_parser.py`, the `convert_point_to_coordinates` function contains a copy-paste error:

```python
x = (x1 + x1) // 2 # BUG: should use x2
y = (y1 + y1) // 2 # BUG: should use y2
```

Both `x` and `y` are computed using only the first coordinate repeated (`x1+x1` and `y1+y1`), instead of averaging the two coordinates (`x1+x2` and `y1+y2`). This means the midpoint is always equal to `x1` and `y1`, ignoring `x2` and `y2` entirely — so the function always returns the top-left corner of the bounding box instead of its center.

## Fix

Change:
```python
x = (x1 + x1) // 2
y = (y1 + y1) // 2
```
To:
```python
x = (x1 + x2) // 2
y = (y1 + y2) // 2
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Open codes/ui_tars/action_parser.py and inspect convert_point_to_coordinates. Verify that the midpoint uses both x coordinates and both y coordinates as described in the issue. Done means the function averages x1 with x2 and y1 with y2 instead of repeating the first coordinate.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-vision
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
88/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.