Last active
July 10, 2020 07:48
-
-
Save masouduut94/05d2429712ee002acfd86425f7050b67 to your computer and use it in GitHub Desktop.
Initializing basic classes
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 Label: | |
""" | |
For each bounding box there are various categories with confidences. Label class keeps track of that information. | |
""" | |
def __init__(self, category: str, confidence: float): | |
self.category = category | |
self.confidence = confidence | |
class Bbox: | |
""" | |
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 | |
class Frame: | |
def __init__(self, frame_id: int): | |
self.frame_id = frame_id | |
self.bboxes = [] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment