Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save victormurcia/84acd3cf6505e101134834a62485125c to your computer and use it in GitHub Desktop.
Extract bounding boxes for a given frame from json
#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