mnotgod96 / AppAgent

AppAgent: Multimodal Agents as Smartphone Users, an LLM-based multimodal agent framework designed to operate smartphone apps.
https://appagent-official.github.io/
MIT License
4.84k stars 511 forks source link

Display Resolution Issue in Python 'image' Popup During 'Human Demonstration' #45

Closed Limitless27 closed 7 months ago

Limitless27 commented 7 months ago

Running the "learn.py" module and selecting the "human demonstration" option, after indicating the task to be performed in the step "Please state the goal of your following demo actions clearly," a popup opens displaying the screen of the device with the intercepted elements.

The Python "image" popup appears with a gigantic resolution, preventing the correct selection of elements.

Furthermore, I wanted to tell you that this project is something exceptional! This is the future!

Screenshot:

Python Image Size

Limitless27 commented 7 months ago

Dear users,

We are pleased to inform you that we have addressed the resolution issue with the window. To enhance the viewing experience, we have added the following lines of code to the "step_recorder" module, just before displaying the image at line 112:

Resize the image to a desired size (e.g., maximum width of 400 pixels)

max_width = 400 scale_factor = min(1.0, max_width / labeled_img.shape[1]) resized_img = cv2.resize(labeled_img, (int(labeled_img.shape[1] scale_factor), int(labeled_img.shape[0] scale_factor)))

This modification ensures that the displayed image is appropriately resized for improved clarity.

image