Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save victormurcia/a40b5bd5f8f5d8519907bc9fe7cd0cb8 to your computer and use it in GitHub Desktop.
Determine number of bounding boxes in frame
#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