Skip to content

Instantly share code, notes, and snippets.

@masouduut94
Last active July 10, 2020 07:48
Show Gist options
  • Save masouduut94/05d2429712ee002acfd86425f7050b67 to your computer and use it in GitHub Desktop.
Save masouduut94/05d2429712ee002acfd86425f7050b67 to your computer and use it in GitHub Desktop.
Initializing basic classes
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