Fix missing image_size parameter in eval.py#17
Open
aug6th wants to merge 1 commit intoxlang-ai:mainfrom
Open
Conversation
The eval() method was calling _eval() with only 4 parameters (coordinate, boxes_type, boxes_size, boxes_coordinate) on line 31, but _eval() requires 5 parameters including image_size (line 35-41). This caused a TypeError when the eval() method was called: TypeError: _eval() missing 1 required positional argument: 'image_size' The image_size parameter is essential because _eval() uses it on line 67 to scale normalized coordinates (values between 0 and 1) to pixel coordinates. This fix adds: 1. Line 30: Extract image_size from the PIL Image object 2. Line 32-34: Pass image_size as the 5th parameter to _eval() This brings eval.py into consistency with all other evaluation scripts (qwen25_vllm_osworld_g_jedi.py, screenspot_v2, screenspot_pro, aguvis, operator) which all correctly pass image_size to _eval(). Note: This bug only affected the eval() method used for standalone testing (line 90-92). The _eval() method itself was always correct and is used properly by all production evaluation scripts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The eval() method was calling _eval() with only 4 parameters (coordinate, boxes_type, boxes_size, boxes_coordinate) on line 31, but _eval() requires 5 parameters including image_size (line 35-41).
This caused a TypeError when the eval() method was called:
TypeError: _eval() missing 1 required positional argument: 'image_size'
The image_size parameter is essential because _eval() uses it on line 67 to scale normalized coordinates (values between 0 and 1) to pixel coordinates.
This fix adds:
This brings eval.py into consistency with all other evaluation scripts (qwen25_vllm_osworld_g_jedi.py, screenspot_v2, screenspot_pro, aguvis, operator) which all correctly pass image_size to _eval().
Note: This bug only affected the eval() method used for standalone testing (line 90-92). The _eval() method itself was always correct and is used properly by all production evaluation scripts.