Created
October 20, 2022 23:03
-
-
Save victormurcia/a40b5bd5f8f5d8519907bc9fe7cd0cb8 to your computer and use it in GitHub Desktop.
Determine number of bounding boxes in frame
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
| #Determine number of bounding boxes in frame | |
| def count_bboxes(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'] | |
| nDetections = len(bbs) | |
| #print(nDetections, " bounding boxes found in frame ", frame_index) | |
| return(nDetections) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment