v2 working

This commit is contained in:
2025-12-08 20:25:20 +01:00
parent 4943a20c11
commit b84c43a898
20 changed files with 956 additions and 162 deletions

View File

@ -8,11 +8,26 @@ import numpy as np
import utils
from draw import draw_new
moves = []
# moves = {}
better_moves = {}
with open('moves.pkl', 'rb') as f: # 'rb' = read binary
with open('replay_tpose.pkl', 'rb') as f: # 'rb' = read binary
moves = pickle.load(f)
movesCopy = {}
for move in moves:
# listx = moves[move].tolist()
# print(type(listx))
# if type(listx) != list:
# listx = listx.tolist()
movesCopy[move.replace(".jpg", "")] = moves[move].tolist()
with open("plikv10.json", "w", encoding="utf-8") as f:
json.dump(movesCopy, f)
exit(1)
startValue = moves[0][0]
totalCount = len(moves)
@ -35,8 +50,13 @@ for i, move in enumerate(moves):
# Do rysowania (np. przesunięcie na ekran)
draw = utils.normalize(move[2]) * 200 + 250
draw = utils.normalize(move[2])
better_moves[round((move[0] - startValue) * 1000)] = draw.tolist()
cv2.imshow('you', draw_new(draw))
cv2.waitKey(1)
time.sleep(0.1)
# cv2.imshow('you', draw_new(draw))
# cv2.waitKey(1)
# time.sleep(0.1)
with open("plik-234.json", "w", encoding="utf-8") as f:
json.dump(better_moves, f)