Created
October 20, 2022 23:02
-
-
Save victormurcia/1751916efef87a71d1d0a2a9d36aa463 to your computer and use it in GitHub Desktop.
read json dictionary
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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