Skip to content

Instantly share code, notes, and snippets.

@masouduut94
Created July 10, 2020 08:21
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/8da56aec32718af02d1996ea4aeaa23c to your computer and use it in GitHub Desktop.
Save masouduut94/8da56aec32718af02d1996ea4aeaa23c to your computer and use it in GitHub Desktop.
def add_label_to_bbox(self, frame_id: int, bbox_id: int, category: str, confidence: float):
bbox = self.find_bbox(frame_id, bbox_id)
if not bbox.labels_full(self.top_k_labels):
bbox.add_label(category, confidence)
else:
raise ValueError("labels in frame_id: {}, bbox_id: {} is fulled".format(frame_id, bbox_id))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment