Spaces:
Runtime error
Runtime error
da03
commited on
Commit
·
1a5bad9
1
Parent(s):
f660fd9
main.py
CHANGED
|
@@ -130,9 +130,9 @@ def draw_trace(image: np.ndarray, previous_actions: List[Tuple[str, List[int]]],
|
|
| 130 |
if x_scaled >= 0 and y_scaled >= 0:
|
| 131 |
x_current = x_scaled * 8
|
| 132 |
y_current = y_scaled * 8
|
| 133 |
-
if not DEBUG_TEACHER_FORCING:
|
| 134 |
-
|
| 135 |
-
|
| 136 |
print ('x_current, y_current', x_current, y_current)
|
| 137 |
draw.ellipse([x_current-3, y_current-3, x_current+3, y_current+3], fill=(0, 255, 0))
|
| 138 |
else:
|
|
@@ -430,7 +430,7 @@ async def websocket_endpoint(websocket: WebSocket):
|
|
| 430 |
action_type = 'N'
|
| 431 |
|
| 432 |
# Format action string
|
| 433 |
-
previous_actions.append((action_type, (x, y)))
|
| 434 |
try:
|
| 435 |
while True:
|
| 436 |
try:
|
|
@@ -469,7 +469,7 @@ async def websocket_endpoint(websocket: WebSocket):
|
|
| 469 |
#previous_actions = [(action_type, mouse_position)]
|
| 470 |
if not DEBUG_TEACHER_FORCING:
|
| 471 |
x, y = mouse_position
|
| 472 |
-
mouse_position = (x//8, y//8)
|
| 473 |
previous_actions.append((action_type, mouse_position))
|
| 474 |
# Log the start time
|
| 475 |
start_time = time.time()
|
|
|
|
| 130 |
if x_scaled >= 0 and y_scaled >= 0:
|
| 131 |
x_current = x_scaled * 8
|
| 132 |
y_current = y_scaled * 8
|
| 133 |
+
#if not DEBUG_TEACHER_FORCING:
|
| 134 |
+
# x_current = x_current *8
|
| 135 |
+
# y_current = y_current *8
|
| 136 |
print ('x_current, y_current', x_current, y_current)
|
| 137 |
draw.ellipse([x_current-3, y_current-3, x_current+3, y_current+3], fill=(0, 255, 0))
|
| 138 |
else:
|
|
|
|
| 430 |
action_type = 'N'
|
| 431 |
|
| 432 |
# Format action string
|
| 433 |
+
previous_actions.append((action_type, (x*8, y*8)))
|
| 434 |
try:
|
| 435 |
while True:
|
| 436 |
try:
|
|
|
|
| 469 |
#previous_actions = [(action_type, mouse_position)]
|
| 470 |
if not DEBUG_TEACHER_FORCING:
|
| 471 |
x, y = mouse_position
|
| 472 |
+
#mouse_position = (x//8, y//8)
|
| 473 |
previous_actions.append((action_type, mouse_position))
|
| 474 |
# Log the start time
|
| 475 |
start_time = time.time()
|