Skip to content

Instantly share code, notes, and snippets.

@papr
Created July 17, 2019 11:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save papr/655cc5f005ca032b0eb602317e89f9ba to your computer and use it in GitHub Desktop.
Save papr/655cc5f005ca032b0eb602317e89f9ba to your computer and use it in GitHub Desktop.
import msgpack
ref_file_path = "reference_locations.msgpack"
with open(ref_file_path, "rb") as fh:
ref_locs = msgpack.unpack(fh, raw=False)
print("Reference location data format:", ref_locs["version"])
# Reference locations
# ref_locs["data"] = [ref_loc, ...]
# ref_loc = [[screen_x, screen_y], frame_index, timestamp]
ref_loc = ref_locs["data"][0] # requires at least one reference location
[screen_x, screen_y], frame_index, timestamp = ref_loc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment