Skip to content

Instantly share code, notes, and snippets.

@masouduut94
Created July 10, 2020 08:15
Show Gist options
  • Save masouduut94/fb15dcea2792903c2eb3e22dde1921b6 to your computer and use it in GitHub Desktop.
Save masouduut94/fb15dcea2792903c2eb3e22dde1921b6 to your computer and use it in GitHub Desktop.
def add_bbox(self, bbox_id: int, top: int, left: int, width: int, height: int):
bboxes_ids = [bbox.bbox_id for bbox in self.bboxes]
if bbox_id not in bboxes_ids:
self.bboxes.append(Bbox(bbox_id, top, left, width, height))
else:
raise ValueError("Frame with id: {} already has a Bbox with id: {}".format(self.frame_id, bbox_id))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment