mirror of
https://github.com/Wan-Video/Wan2.1.git
synced 2025-11-04 14:16:57 +00:00
25 lines
556 B
Python
25 lines
556 B
Python
class ObjectInfo:
|
|
"""
|
|
Store meta information for an object
|
|
"""
|
|
def __init__(self, id: int):
|
|
self.id = id
|
|
self.poke_count = 0 # count number of detections missed
|
|
|
|
def poke(self) -> None:
|
|
self.poke_count += 1
|
|
|
|
def unpoke(self) -> None:
|
|
self.poke_count = 0
|
|
|
|
def __hash__(self):
|
|
return hash(self.id)
|
|
|
|
def __eq__(self, other):
|
|
if type(other) == int:
|
|
return self.id == other
|
|
return self.id == other.id
|
|
|
|
def __repr__(self):
|
|
return f'(ID: {self.id})'
|