Update compressor for data annotation

This commit is contained in:
Timothyxxx
2023-12-04 00:51:33 +08:00
parent 8cb31f1bb0
commit 8818779329
8 changed files with 2519 additions and 151 deletions

View File

@@ -66,14 +66,26 @@ class PythonController:
button = parameters["button"]
x = parameters["x"]
y = parameters["y"]
self.execute_python_command(f"pyautogui.click(button='{button}', x={x}, y={y})")
if "num_clicks" in parameters:
num_clicks = parameters["num_clicks"]
self.execute_python_command(f"pyautogui.click(button='{button}', x={x}, y={y}, clicks={num_clicks})")
else:
self.execute_python_command(f"pyautogui.click(button='{button}', x={x}, y={y})")
elif "button" in parameters and "x" not in parameters and "y" not in parameters:
button = parameters["button"]
self.execute_python_command(f"pyautogui.click(button='{button}')")
if "num_clicks" in parameters:
num_clicks = parameters["num_clicks"]
self.execute_python_command(f"pyautogui.click(button='{button}', clicks={num_clicks})")
else:
self.execute_python_command(f"pyautogui.click(button='{button}')")
elif "button" not in parameters and "x" in parameters and "y" in parameters:
x = parameters["x"]
y = parameters["y"]
self.execute_python_command(f"pyautogui.click(x={x}, y={y})")
if "num_clicks" in parameters:
num_clicks = parameters["num_clicks"]
self.execute_python_command(f"pyautogui.click(x={x}, y={y}, clicks={num_clicks})")
else:
self.execute_python_command(f"pyautogui.click(x={x}, y={y})")
else:
raise Exception(f"Unknown parameters: {parameters}")