Spaces:
Runtime error
Runtime error
da03
commited on
Commit
·
09a0506
1
Parent(s):
85b44f8
main.py
CHANGED
@@ -198,7 +198,7 @@ def predict_next_frame(previous_frames: List[np.ndarray], previous_actions: List
|
|
198 |
# Process initial actions if there are not enough previous actions
|
199 |
while len(previous_actions) < 8:
|
200 |
x, y = map(int, initial_actions.pop(0).split(':'))
|
201 |
-
previous_actions.insert(0, ("
|
202 |
prev_x = 0
|
203 |
prev_y = 0
|
204 |
print ('here')
|
@@ -222,8 +222,8 @@ def predict_next_frame(previous_frames: List[np.ndarray], previous_actions: List
|
|
222 |
previous_actions.append((action_type, (x, y)))
|
223 |
|
224 |
for action_type, pos in previous_actions: #[-8:]:
|
225 |
-
print ('here3')
|
226 |
-
if action_type == "
|
227 |
x, y = pos
|
228 |
#norm_x = int(round(x / 256 * 1024)) #x + (1920 - 256) / 2
|
229 |
#norm_y = int(round(y / 256 * 640)) #y + (1080 - 256) / 2
|
@@ -237,7 +237,7 @@ def predict_next_frame(previous_frames: List[np.ndarray], previous_actions: List
|
|
237 |
action_descriptions.append(format_action(f'{norm_x:.0f}~{norm_y:.0f}', x==0 and y==0))
|
238 |
prev_x = norm_x
|
239 |
prev_y = norm_y
|
240 |
-
elif action_type == "
|
241 |
x, y = pos
|
242 |
#norm_x = int(round(x / 256 * 1024)) #x + (1920 - 256) / 2
|
243 |
#norm_y = int(round(y / 256 * 640)) #y + (1080 - 256) / 2
|
@@ -250,7 +250,10 @@ def predict_next_frame(previous_frames: List[np.ndarray], previous_actions: List
|
|
250 |
#action_descriptions.append(format_action(f'{norm_x-prev_x:.0f}~{norm_y-prev_y:.0f}', x==0 and y==0))
|
251 |
action_descriptions.append(format_action(f'{norm_x:.0f}~{norm_y:.0f}', x==0 and y==0, True))
|
252 |
elif action_type == "right_click":
|
|
|
253 |
action_descriptions.append("right_click")
|
|
|
|
|
254 |
|
255 |
prompt = " ".join(action_descriptions[-8:])
|
256 |
print(prompt)
|
|
|
198 |
# Process initial actions if there are not enough previous actions
|
199 |
while len(previous_actions) < 8:
|
200 |
x, y = map(int, initial_actions.pop(0).split(':'))
|
201 |
+
previous_actions.insert(0, ("N", unnorm_coords(x, y)))
|
202 |
prev_x = 0
|
203 |
prev_y = 0
|
204 |
print ('here')
|
|
|
222 |
previous_actions.append((action_type, (x, y)))
|
223 |
|
224 |
for action_type, pos in previous_actions: #[-8:]:
|
225 |
+
print ('here3', action_type, pos)
|
226 |
+
if action_type == "N":
|
227 |
x, y = pos
|
228 |
#norm_x = int(round(x / 256 * 1024)) #x + (1920 - 256) / 2
|
229 |
#norm_y = int(round(y / 256 * 640)) #y + (1080 - 256) / 2
|
|
|
237 |
action_descriptions.append(format_action(f'{norm_x:.0f}~{norm_y:.0f}', x==0 and y==0))
|
238 |
prev_x = norm_x
|
239 |
prev_y = norm_y
|
240 |
+
elif action_type == "L":
|
241 |
x, y = pos
|
242 |
#norm_x = int(round(x / 256 * 1024)) #x + (1920 - 256) / 2
|
243 |
#norm_y = int(round(y / 256 * 640)) #y + (1080 - 256) / 2
|
|
|
250 |
#action_descriptions.append(format_action(f'{norm_x-prev_x:.0f}~{norm_y-prev_y:.0f}', x==0 and y==0))
|
251 |
action_descriptions.append(format_action(f'{norm_x:.0f}~{norm_y:.0f}', x==0 and y==0, True))
|
252 |
elif action_type == "right_click":
|
253 |
+
assert False
|
254 |
action_descriptions.append("right_click")
|
255 |
+
else:
|
256 |
+
assert False
|
257 |
|
258 |
prompt = " ".join(action_descriptions[-8:])
|
259 |
print(prompt)
|