Skip to content

Instantly share code, notes, and snippets.

@victormurcia
Created October 20, 2022 23:02
Show Gist options
  • Select an option

  • Save victormurcia/1751916efef87a71d1d0a2a9d36aa463 to your computer and use it in GitHub Desktop.

Select an option

Save victormurcia/1751916efef87a71d1d0a2a9d36aa463 to your computer and use it in GitHub Desktop.
read json dictionary
#Get dictionary from json file
def read_json_dict(path2json):
"""
Args:
path2json: (str) path to .MP4 json file containing player bounding boxes
Returns:
bb_dict: (dict) Dictionary containing bounding boxes in each frame
"""
# Opening JSON file
f = open(path2json)
# Returns JSON object as a dictionary
bb_dict = json.load(f)
f.close()
return(bb_dict)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment