da03 commited on
Commit
7ef36c6
·
1 Parent(s): d08c3bf
Files changed (1) hide show
  1. main.py +4 -4
main.py CHANGED
@@ -218,7 +218,7 @@ def predict_next_frame(previous_frames: List[np.ndarray], previous_actions: List
218
  #norm_y = int(round(y / 256 * 640)) #y + (1080 - 256) / 2
219
  norm_x = x + (1920 - 512) / 2
220
  norm_y = y + (1080 - 512) / 2
221
- if True and DEBUG_TEACHER_FORCING:
222
  norm_x = x
223
  norm_y = y
224
  #action_descriptions.append(f"{(norm_x-prev_x):.0f}~{(norm_y-prev_y):.0f}")
@@ -232,7 +232,7 @@ def predict_next_frame(previous_frames: List[np.ndarray], previous_actions: List
232
  #norm_y = int(round(y / 256 * 640)) #y + (1080 - 256) / 2
233
  norm_x = x + (1920 - 512) / 2
234
  norm_y = y + (1080 - 512) / 2
235
- if True and DEBUG_TEACHER_FORCING:
236
  norm_x = x #+ (1920 - 512) / 2
237
  norm_y = y #+ (1080 - 512) / 2
238
  #if DEBUG:
@@ -369,7 +369,7 @@ async def websocket_endpoint(websocket: WebSocket):
369
  positions = positions[1:]
370
  x, y, action_type = parse_action_string(position)
371
  mouse_position = (x, y)
372
- if False:
373
  previous_actions.append((action_type, mouse_position))
374
  #previous_actions = [(action_type, mouse_position)]
375
 
@@ -386,7 +386,7 @@ async def websocket_endpoint(websocket: WebSocket):
386
  if False and DEBUG_TEACHER_FORCING:
387
  img = Image.open(f"record_100/image_{82+len(previous_frames)}.png")
388
  previous_frames.append(img)
389
- elif False:
390
  previous_frames.append(next_frame_append)
391
 
392
  # Convert the numpy array to a base64 encoded image
 
218
  #norm_y = int(round(y / 256 * 640)) #y + (1080 - 256) / 2
219
  norm_x = x + (1920 - 512) / 2
220
  norm_y = y + (1080 - 512) / 2
221
+ if False and DEBUG_TEACHER_FORCING:
222
  norm_x = x
223
  norm_y = y
224
  #action_descriptions.append(f"{(norm_x-prev_x):.0f}~{(norm_y-prev_y):.0f}")
 
232
  #norm_y = int(round(y / 256 * 640)) #y + (1080 - 256) / 2
233
  norm_x = x + (1920 - 512) / 2
234
  norm_y = y + (1080 - 512) / 2
235
+ if False and DEBUG_TEACHER_FORCING:
236
  norm_x = x #+ (1920 - 512) / 2
237
  norm_y = y #+ (1080 - 512) / 2
238
  #if DEBUG:
 
369
  positions = positions[1:]
370
  x, y, action_type = parse_action_string(position)
371
  mouse_position = (x, y)
372
+ if True:
373
  previous_actions.append((action_type, mouse_position))
374
  #previous_actions = [(action_type, mouse_position)]
375
 
 
386
  if False and DEBUG_TEACHER_FORCING:
387
  img = Image.open(f"record_100/image_{82+len(previous_frames)}.png")
388
  previous_frames.append(img)
389
+ elif True:
390
  previous_frames.append(next_frame_append)
391
 
392
  # Convert the numpy array to a base64 encoded image