yuntian-deng commited on
Commit
6e076cc
·
1 Parent(s): 5f4dfaa

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +4 -4
main.py CHANGED
@@ -267,8 +267,8 @@ async def websocket_endpoint(websocket: WebSocket):
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))
271
- previous_actions = [(action_type, mouse_position)]
272
 
273
  # Log the start time
274
  start_time = time.time()
@@ -276,8 +276,8 @@ async def websocket_endpoint(websocket: WebSocket):
276
  # Predict the next frame based on the previous frames and actions
277
  next_frame, next_frame_append = predict_next_frame(previous_frames, previous_actions)
278
  # Load and append the corresponding ground truth image instead of model output
279
- img = Image.open(f"image_{len(previous_frames)%7}.png")
280
- #previous_frames.append(np.array(img))
281
 
282
  # Convert the numpy array to a base64 encoded image
283
  img = Image.fromarray(next_frame)
 
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))
271
+ #previous_actions = [(action_type, mouse_position)]
272
 
273
  # Log the start time
274
  start_time = time.time()
 
276
  # Predict the next frame based on the previous frames and actions
277
  next_frame, next_frame_append = predict_next_frame(previous_frames, previous_actions)
278
  # Load and append the corresponding ground truth image instead of model output
279
+ #img = Image.open(f"image_{len(previous_frames)%7}.png")
280
+ previous_frames.append(next_frame)
281
 
282
  # Convert the numpy array to a base64 encoded image
283
  img = Image.fromarray(next_frame)