generated from roboflow/template-python
    
        
        - 
                Notifications
    You must be signed in to change notification settings 
- Fork 3k
Closed
Labels
Q2.2024Tasks planned for execution in Q2 2024.Tasks planned for execution in Q2 2024.api: linezoneLineZone APILineZone APIenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
Description
Currently, sv.LineZone provides only aggregated counts - all classes are thrown into one bucket. In the past, many users have asked us to provide more granular - per class count. This can be achieved by adding class_in_count and class_out_count dictionaries that will store per-class counts.
API
class LineZone:
    def __init__(
        self,
        start: Point,
        end: Point,
        triggering_anchors: Iterable[Position] = (
            Position.TOP_LEFT,
            Position.TOP_RIGHT,
            Position.BOTTOM_LEFT,
            Position.BOTTOM_RIGHT,
        ),
    ):
        # Existing initialization code...
        self.class_in_count: Dict[int, int] = {}
        self.class_out_count: Dict[int, int] = {}
    def trigger(self, detections: Detections) -> Tuple[np.ndarray, np.ndarray]:
        crossed_in = np.full(len(detections), False)
        crossed_out = np.full(len(detections), False)
        # Required logic changes...Additional
- Note: Please share a Google Colab with minimal code to test the new feature. We know it's additional work, but it will definitely speed up the review process. Each change must be tested by the reviewer. Setting up a local environment to do this is time-consuming. Please ensure that Google Colab can be accessed without any issues (make it public). Thank you! 🙏🏻
tonmoy-TS
Metadata
Metadata
Assignees
Labels
Q2.2024Tasks planned for execution in Q2 2024.Tasks planned for execution in Q2 2024.api: linezoneLineZone APILineZone APIenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Type
Projects
Status
Done