Spaces:
Runtime error
Runtime error
Commit
·
ee927fc
1
Parent(s):
c520c64
Update main.py
Browse files
main.py
CHANGED
@@ -103,6 +103,7 @@ def predict_next_frame(previous_frames: List[np.ndarray], previous_actions: List
|
|
103 |
action_descriptions = []
|
104 |
initial_actions = ['901:604', '901:604', '901:604', '901:604', '901:604', '901:604', '901:604', '921:604']
|
105 |
initial_actions = ['0:0'] * 7
|
|
|
106 |
def unnorm_coords(x, y):
|
107 |
return int(x), int(y) #int(x - (1920 - 256) / 2), int(y - (1080 - 256) / 2)
|
108 |
|
@@ -179,8 +180,10 @@ async def websocket_endpoint(websocket: WebSocket):
|
|
179 |
#positions = positions[1:]
|
180 |
mouse_position = position.split('~')
|
181 |
mouse_position = [int(item) for item in mouse_position]
|
|
|
182 |
|
183 |
-
previous_actions.append((action_type, mouse_position))
|
|
|
184 |
|
185 |
# Log the start time
|
186 |
start_time = time.time()
|
|
|
103 |
action_descriptions = []
|
104 |
initial_actions = ['901:604', '901:604', '901:604', '901:604', '901:604', '901:604', '901:604', '921:604']
|
105 |
initial_actions = ['0:0'] * 7
|
106 |
+
initial_actions = ['N N N N N : N N N N N'] * 7
|
107 |
def unnorm_coords(x, y):
|
108 |
return int(x), int(y) #int(x - (1920 - 256) / 2), int(y - (1080 - 256) / 2)
|
109 |
|
|
|
180 |
#positions = positions[1:]
|
181 |
mouse_position = position.split('~')
|
182 |
mouse_position = [int(item) for item in mouse_position]
|
183 |
+
mouse_position = '+ 0 8 1 5 : + 0 3 3 5'
|
184 |
|
185 |
+
#previous_actions.append((action_type, mouse_position))
|
186 |
+
previous_actions = [(action_type, mouse_position))]
|
187 |
|
188 |
# Log the start time
|
189 |
start_time = time.time()
|