Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save victormurcia/4f3f0a9e27d2116763b45dc691c46fd5 to your computer and use it in GitHub Desktop.
Find first frame that contains detections
#Find first frame that contains detections
def findFrameSpacing(bb_dict):
"""
Args:
bb_dict: (dict) dictionary from json file
Returns:
spacing: (int) Spacing between frames in json
"""
frame0 = bb_dict['frames'][0]['frame_index']
frame1 = bb_dict['frames'][1]['frame_index']
spacing = abs(frame1 - frame0)
print('The frame spacing is ', spacing)
return(spacing)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment