Skip to content

Commit

Permalink
Removed LineZone property docstrings; added 2 properties to Attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
LinasKo committed Nov 7, 2024
1 parent c3d7dc0 commit abcb055
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions supervision/detection/line_zone.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ class LineZone:
to inside.
out_count (int): The number of objects that have crossed the line from inside
to outside.
in_count_per_class (Dict[int, int]): Number of objects of each class that have
crossed the line from outside to inside.
out_count_per_class (Dict[int, int]): Number of objects of each class that have
crossed the line from inside to outside.
Example:
```python
Expand Down Expand Up @@ -107,34 +111,18 @@ def __init__(

@property
def in_count(self) -> int:
"""
Number of objects that have crossed the line from
outside to inside.
"""
return sum(self._in_count_per_class.values())

@property
def out_count(self) -> int:
"""
Number of objects that have crossed the line from
inside to outside.
"""
return sum(self._out_count_per_class.values())

@property
def in_count_per_class(self) -> Dict[int, int]:
"""
Number of objects of each class that have crossed
the line from outside to inside.
"""
return dict(self._in_count_per_class)

@property
def out_count_per_class(self) -> Dict[int, int]:
"""
Number of objects of each class that have crossed the line
from inside to outside.
"""
return dict(self._out_count_per_class)

def trigger(self, detections: Detections) -> Tuple[np.ndarray, np.ndarray]:
Expand Down

0 comments on commit abcb055

Please sign in to comment.