Spaces:
Runtime error
Runtime error
Commit
·
48180e7
1
Parent(s):
a3217ba
Update main.py
Browse files
main.py
CHANGED
@@ -93,7 +93,7 @@ def predict_next_frame(previous_frames: List[np.ndarray], previous_actions: List
|
|
93 |
initial_actions = ['901:604', '901:604', '901:604', '901:604', '901:604', '901:604', '901:604', '921:604']
|
94 |
initial_actions = ['0:0'] * 7
|
95 |
def unnorm_coords(x, y):
|
96 |
-
return int(x - (1920 - 256) / 2), int(y - (1080 - 256) / 2)
|
97 |
|
98 |
# Process initial actions if there are not enough previous actions
|
99 |
while len(previous_actions) < 7:
|
@@ -106,8 +106,8 @@ def predict_next_frame(previous_frames: List[np.ndarray], previous_actions: List
|
|
106 |
for action_type, pos in previous_actions[-7:]:
|
107 |
if action_type == "move":
|
108 |
x, y = pos
|
109 |
-
norm_x = x + (1920 - 256) / 2
|
110 |
-
norm_y = y + (1080 - 256) / 2
|
111 |
action_descriptions.append(f"{norm_x:.0f}~{norm_y:.0f}")
|
112 |
elif action_type == "left_click":
|
113 |
action_descriptions.append("left_click")
|
|
|
93 |
initial_actions = ['901:604', '901:604', '901:604', '901:604', '901:604', '901:604', '901:604', '921:604']
|
94 |
initial_actions = ['0:0'] * 7
|
95 |
def unnorm_coords(x, y):
|
96 |
+
return int(x), int(y) #int(x - (1920 - 256) / 2), int(y - (1080 - 256) / 2)
|
97 |
|
98 |
# Process initial actions if there are not enough previous actions
|
99 |
while len(previous_actions) < 7:
|
|
|
106 |
for action_type, pos in previous_actions[-7:]:
|
107 |
if action_type == "move":
|
108 |
x, y = pos
|
109 |
+
norm_x = int(round(x / 256 * 1024)) #x + (1920 - 256) / 2
|
110 |
+
norm_y = int(round(y / 256 * 640)) #y + (1080 - 256) / 2
|
111 |
action_descriptions.append(f"{norm_x:.0f}~{norm_y:.0f}")
|
112 |
elif action_type == "left_click":
|
113 |
action_descriptions.append("left_click")
|