Created
July 10, 2020 08:24
-
-
Save masouduut94/59cc916d6b14258442edab2956a0caac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Bbox(BaseJsonParser): | |
""" | |
This class keeps the information of each bounding box in the frame. | |
""" | |
def __init__(self, bbox_id, top, left, width, height): | |
self.labels = [] | |
self.bbox_id = bbox_id | |
self.top = top | |
self.left = left | |
self.width = width | |
self.height = height | |
def add_label(self, category, confidence): | |
# adds category and confidence only if top_k is not exceeded. | |
self.labels.append(Label(category, confidence)) | |
def labels_full(self, value): | |
return len(self.labels) == value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment