Skip to content

Instantly share code, notes, and snippets.

@masouduut94
Created July 10, 2020 08:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masouduut94/b7a097a01bd0f7fa5fc83642364ccd03 to your computer and use it in GitHub Desktop.
Save masouduut94/b7a097a01bd0f7fa5fc83642364ccd03 to your computer and use it in GitHub Desktop.
def find_bbox(self, frame_id: int, bbox_id: int):
if not self.bbox_exists(frame_id, bbox_id):
raise ValueError("frame with id: {} does not contain bbox with id: {}".format(frame_id, bbox_id))
bboxes = {bbox.bbox_id: bbox for bbox in self.frames[frame_id].bboxes}
return bboxes.get(bbox_id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment