Skip to content

Classify the object that crossed the line #463

Answered by Matthias1982
Xkim2000 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi
I made some test and modified the class LineZone in line_counter the following way:

`class LineZone:
def init(self, start: Point, end: Point):
self.vector = Vector(start=start, end=end)
self.tracker_state: Dict[str, bool] = {}
self.in_count: int = 0
self.out_count: int = 0
self.in_count_car: int = 0
self.out_count_car: int = 0
self.in_count_truck: int = 0
self.out_count_truck: int = 0

def trigger(self, detections: Detections) -> Tuple[np.ndarray, np.ndarray]:
    crossed_in = np.full(len(detections), False)
    crossed_out = np.full(len(detections), False)

    for i, detection in enumerate(detections):
        xyxy, _, confidence, class_id, tracker_id = detection  # Dummy-Zuweisung, e…

Replies: 3 comments 8 replies

Comment options

You must be logged in to vote
1 reply
@Xkim2000
Comment options

Comment options

You must be logged in to vote
4 replies
@Xkim2000
Comment options

@Xkim2000
Comment options

@Matthias1982
Comment options

Answer selected by SkalskiP
@Xkim2000
Comment options

Comment options

You must be logged in to vote
3 replies
@Xkim2000
Comment options

@Matthias1982
Comment options

@AlainPilon
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants