attempt pickling images
This commit is contained in:
parent
74b1a44168
commit
1a6b55b21d
1 changed files with 4 additions and 1 deletions
|
@ -105,6 +105,8 @@ print("pairing points for one eye took: " + str(endT - startT) + " ms")
|
|||
print("start populating matrices for each blink frame")
|
||||
startT = curr_time = round(time.time()*1000)
|
||||
|
||||
interpolated_faces = []
|
||||
|
||||
# TODO look into the possibility of precomputing and more importantly storing the matrix objects
|
||||
for alpha in range(0,11):
|
||||
offscreen_interpolated_canvas = matrix.CreateFrameCanvas()
|
||||
|
@ -116,6 +118,7 @@ for alpha in range(0,11):
|
|||
face = left_eye + right_eye + nose + mouth
|
||||
|
||||
interpolated_face_image = generate_image_from_point_array(face, 128, 32)
|
||||
interpolated_faces.append(interpolated_face_image)
|
||||
|
||||
offscreen_interpolated_canvas.SetImage(interpolated_face_image, unsafe=False)
|
||||
blinkFrameCanvases.append(offscreen_interpolated_canvas)
|
||||
|
@ -131,7 +134,7 @@ proot_state.blink()
|
|||
|
||||
# Store the object to disk
|
||||
with open('my_object.pickle', 'wb') as file:
|
||||
pickle.dump(blinkFrameCanvases, file)
|
||||
pickle.dump(interpolated_faces, file)
|
||||
|
||||
|
||||
# functions called by the MQTT listener
|
||||
|
|
Loading…
Add table
Reference in a new issue