Spaces:
Runtime error
Runtime error
da03
commited on
Commit
·
c94bfc7
1
Parent(s):
1803da7
main.py
CHANGED
|
@@ -132,7 +132,7 @@ def load_initial_images(width, height):
|
|
| 132 |
if DEBUG_TEACHER_FORCING:
|
| 133 |
# Load the previous 7 frames for image_81
|
| 134 |
for i in range(114-7, 114): # Load images 74-80
|
| 135 |
-
img = Image.open(f"record_10003/image_{i}.png")
|
| 136 |
initial_images.append(np.array(img))
|
| 137 |
else:
|
| 138 |
#assert False
|
|
@@ -338,8 +338,8 @@ async def websocket_endpoint(websocket: WebSocket):
|
|
| 338 |
'L + 0 4 7 3 : + 0 0 8 7', 'N + 0 1 0 9 : + 0 3 4 4',
|
| 339 |
'N + 0 0 5 2 : + 0 1 9 4', 'N + 0 3 6 5 : + 0 2 3 2',
|
| 340 |
'N + 0 3 8 9 : + 0 2 4 5', 'N + 0 0 2 0 : + 0 0 5 9',
|
| 341 |
-
'N + 0 4 7 3 : + 0 1 5 7', 'L + 0 1 9 1 : + 0 0 8 7',
|
| 342 |
-
'L + 0 1 9 1 : + 0 0 8 7', 'N + 0 3 4 3 : + 0 2 6 3', ]
|
| 343 |
#'N + 0 2 0 5 : + 0 1 3 3']
|
| 344 |
previous_actions = []
|
| 345 |
for action in debug_actions[-8:]:
|
|
@@ -364,14 +364,16 @@ async def websocket_endpoint(websocket: WebSocket):
|
|
| 364 |
'N + 0 9 0 5 : + 0 3 8 8', 'N + 0 8 6 8 : + 0 4 0 0',
|
| 365 |
'N + 0 8 3 2 : + 0 4 1 1'
|
| 366 |
]
|
| 367 |
-
positions = ['
|
| 368 |
-
|
| 369 |
-
|
| 370 |
-
|
| 371 |
-
|
| 372 |
-
|
| 373 |
-
|
| 374 |
-
|
|
|
|
|
|
|
| 375 |
#positions = positions[:4]
|
| 376 |
try:
|
| 377 |
while True:
|
|
@@ -418,6 +420,7 @@ async def websocket_endpoint(websocket: WebSocket):
|
|
| 418 |
img = Image.open(f"record_10003/image_{114+len(previous_frames)}.png")
|
| 419 |
previous_frames.append(img)
|
| 420 |
elif True:
|
|
|
|
| 421 |
previous_frames.append(next_frame_append)
|
| 422 |
#previous_frames = []
|
| 423 |
|
|
|
|
| 132 |
if DEBUG_TEACHER_FORCING:
|
| 133 |
# Load the previous 7 frames for image_81
|
| 134 |
for i in range(114-7, 114): # Load images 74-80
|
| 135 |
+
img = Image.open(f"record_10003/image_{i}.png")#.resize((width, height))
|
| 136 |
initial_images.append(np.array(img))
|
| 137 |
else:
|
| 138 |
#assert False
|
|
|
|
| 338 |
'L + 0 4 7 3 : + 0 0 8 7', 'N + 0 1 0 9 : + 0 3 4 4',
|
| 339 |
'N + 0 0 5 2 : + 0 1 9 4', 'N + 0 3 6 5 : + 0 2 3 2',
|
| 340 |
'N + 0 3 8 9 : + 0 2 4 5', 'N + 0 0 2 0 : + 0 0 5 9',
|
| 341 |
+
'N + 0 4 7 3 : + 0 1 5 7', ]#'L + 0 1 9 1 : + 0 0 8 7',
|
| 342 |
+
#'L + 0 1 9 1 : + 0 0 8 7', 'N + 0 3 4 3 : + 0 2 6 3', ]
|
| 343 |
#'N + 0 2 0 5 : + 0 1 3 3']
|
| 344 |
previous_actions = []
|
| 345 |
for action in debug_actions[-8:]:
|
|
|
|
| 364 |
'N + 0 9 0 5 : + 0 3 8 8', 'N + 0 8 6 8 : + 0 4 0 0',
|
| 365 |
'N + 0 8 3 2 : + 0 4 1 1'
|
| 366 |
]
|
| 367 |
+
positions = ['L + 0 1 9 1 : + 0 0 8 7',
|
| 368 |
+
'L + 0 1 9 1 : + 0 0 8 7', 'N + 0 3 4 3 : + 0 2 6 3',
|
| 369 |
+
'N + 0 2 0 5 : + 0 1 3 3', 'N + 0 0 7 6 : + 0 3 4 5',
|
| 370 |
+
'N + 0 3 1 8 : + 0 3 3 3', 'N + 0 2 5 4 : + 0 2 9 0',
|
| 371 |
+
'N + 0 1 0 6 : + 0 1 6 4', 'N + 0 0 7 4 : + 0 2 8 4',
|
| 372 |
+
'N + 0 0 2 4 : + 0 0 4 1', 'N + 0 1 5 0 : + 0 3 8 3',
|
| 373 |
+
'N + 0 4 0 5 : + 0 1 6 8', 'N + 0 0 5 4 : + 0 3 2 4',
|
| 374 |
+
'N + 0 2 9 0 : + 0 1 4 1', 'N + 0 4 0 2 : + 0 0 0 9',
|
| 375 |
+
'N + 0 3 0 7 : + 0 3 3 2', 'N + 0 2 2 0 : + 0 3 7 1',
|
| 376 |
+
'N + 0 0 8 2 : + 0 1 5 1']
|
| 377 |
#positions = positions[:4]
|
| 378 |
try:
|
| 379 |
while True:
|
|
|
|
| 420 |
img = Image.open(f"record_10003/image_{114+len(previous_frames)}.png")
|
| 421 |
previous_frames.append(img)
|
| 422 |
elif True:
|
| 423 |
+
assert False
|
| 424 |
previous_frames.append(next_frame_append)
|
| 425 |
#previous_frames = []
|
| 426 |
|