Spaces:
Runtime error
Runtime error
Commit
·
a076741
1
Parent(s):
23e2ef6
Update main.py
Browse files
main.py
CHANGED
@@ -193,9 +193,9 @@ def predict_next_frame(previous_frames: List[np.ndarray], previous_actions: List
|
|
193 |
x, y = pos
|
194 |
norm_x = int(round(x / 256 * 1024)) #x + (1920 - 256) / 2
|
195 |
norm_y = int(round(y / 256 * 640)) #y + (1080 - 256) / 2
|
196 |
-
if DEBUG:
|
197 |
-
|
198 |
-
|
199 |
#action_descriptions.append(f"{(norm_x-prev_x):.0f}~{(norm_y-prev_y):.0f}")
|
200 |
#action_descriptions.append(format_action(f'{norm_x-prev_x:.0f}~{norm_y-prev_y:.0f}', x==0 and y==0))
|
201 |
action_descriptions.append(format_action(f'{norm_x:.0f}~{norm_y:.0f}', x==0 and y==0))
|
@@ -263,8 +263,8 @@ async def websocket_endpoint(websocket: WebSocket):
|
|
263 |
if DEBUG:
|
264 |
position = positions[0]
|
265 |
#positions = positions[1:]
|
266 |
-
mouse_position = position.split('~')
|
267 |
-
mouse_position = [int(item) for item in mouse_position]
|
268 |
#mouse_position = '+ 0 8 1 5 : + 0 3 3 5'
|
269 |
|
270 |
#previous_actions.append((action_type, mouse_position))
|
|
|
193 |
x, y = pos
|
194 |
norm_x = int(round(x / 256 * 1024)) #x + (1920 - 256) / 2
|
195 |
norm_y = int(round(y / 256 * 640)) #y + (1080 - 256) / 2
|
196 |
+
#if DEBUG:
|
197 |
+
# norm_x = x
|
198 |
+
# norm_y = y
|
199 |
#action_descriptions.append(f"{(norm_x-prev_x):.0f}~{(norm_y-prev_y):.0f}")
|
200 |
#action_descriptions.append(format_action(f'{norm_x-prev_x:.0f}~{norm_y-prev_y:.0f}', x==0 and y==0))
|
201 |
action_descriptions.append(format_action(f'{norm_x:.0f}~{norm_y:.0f}', x==0 and y==0))
|
|
|
263 |
if DEBUG:
|
264 |
position = positions[0]
|
265 |
#positions = positions[1:]
|
266 |
+
#mouse_position = position.split('~')
|
267 |
+
#mouse_position = [int(item) for item in mouse_position]
|
268 |
#mouse_position = '+ 0 8 1 5 : + 0 3 3 5'
|
269 |
|
270 |
#previous_actions.append((action_type, mouse_position))
|