def main():
for i in list(range(4))[::-1]:
print(i+1)
time.sleep(1)
c=0
last_time = time.time()
while True:
c+=1
screen=grab_screen(title='')
screenG=cv2.cvtColor(screen,cv2.COLOR_BGR2GRAY)
screenG=cv2.resize(screenG,(80,60))
keys=key_check()
output=keys_to_output(keys)
training_data.append([screenG,output])
if c%10==0:
print('Recording at ' + str((10 / (time.time() - last_time)))+' fps')
last_time = time.time()
if len(training_data) % 500 == 0:
print(len(training_data))
np.save(file_name,training_data)
评论列表
文章目录