/claim #760
What kind of change does this PR introduce?
Feature: New cursor replay strategy with visual feedback and self-correction
Summary
This PR addresses #760 by introducing a new cursor replay strategy that improves targeting accuracy using visual feedback and AI-powered self-correction.
Key Features:
This strategy sets the groundwork for improving OpenAdapt’s cursor control system in complex screen environments.
Checklist
test_grid.py
evaluates grid strategyflake8
for Python lintingrequirements.txt
How can your code be run and tested?
pip install -r requirements.txt
python -m experiments.cursor.test_grid
Example Output:
Grid Strategy Evaluation Results:
---------------------------------
Total test cases: 45
Average distance error: 5.2 pixels
Average actions per target: 4.3
Average time per target: 0.82 seconds
Results by grid size:
Grid size: 2x2
Average error: 8.4 pixels
Average actions: 3.0
Average time: 0.65 seconds
Grid size: 4x4
Average error: 4.2 pixels
Average actions: 4.5
Average time: 0.85 seconds
Grid size: 8x8
Average error: 3.1 pixels
Average actions: 5.5
Average time: 0.96 seconds
from openadapt.strategies.cursor import CursorReplayStrategy
from experiments.cursor.grid import GridCursorStrategy
# Visual feedback
strategy = CursorReplayStrategy(recording)
img_with_dot = strategy.paint_dot(screenshot, x=100, y=100)
# Grid approach
grid_strategy = GridCursorStrategy(recording, grid_size=(4, 4))
action = grid_strategy.get_next_action_event(screenshot, window_event)
Dependencies:
Tanmay
@TanCodeX
OpenAdaptAI
@OpenAdaptAI