Created
October 20, 2022 23:06
-
-
Save victormurcia/84acd3cf6505e101134834a62485125c to your computer and use it in GitHub Desktop.
Extract bounding boxes for a given frame from json
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
| #Extract bounding boxes for a given frame from json | |
| def get_bb4frame(bb_dict,frame_index): | |
| """ | |
| Args: | |
| bb_dict: (dict) dictionary from json file | |
| frame: (int) what frame is being processed | |
| Returns: | |
| nDetections: (int) Number of bounding boxes in frame | |
| """ | |
| bbs = bb_dict['frames'][frame_index]['detections'] | |
| #print('These are the coordinates for all bounding boxes in frame', frame_index) | |
| #print(bbs) | |
| return(bbs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment