Open SkalskiP opened 7 months ago
Hey @SkalskiP, I was wondering to work on this. I have this logic in mind, pls confirm if this approach is what you guys want?
Dictionaries to keep track of counts for each class
self.class_in_count: Dict[str, int] = {} self.class_out_count: Dict[str, int] = {}
Updating per class-in and class-out count
class_label = detections.class_labels[i]
if class_label not in self.class_in_count:
self.class_in_count[class_label] = 0
self.class_in_count[class_label] += 1
else:
self.out_count += 1
crossed_out[i] = True
# Updating per-class out count
class_label = detections.class_labels[i]
if class_label not in self.class_out_count:
self.class_out_count[class_label] = 0
self.class_out_count[class_label] += 1
Hey @SkalskiP ππ https://colab.research.google.com/drive/1HxRcfzqnS6axAlYPiPpe8WLblfdn6fC_?usp=sharing
This is what I was talking about. Please tell me whether this is what you want.
Hi, @RaghavvGupta, Would that be the implementation of a current count or the total count?
I have tried implementing per-class counting. It includes dictionaries class_in_count
and class_out_count
to store counts for each class separately. The counts within these dictionaries are updated during each call to the trigger
method, representing the current count of objects for each class based on their movement across the line.
@RaghavvGupta, submit PR so we can move forward with the review process.
Hello, is this being worked on?
Hi @caiquejjx π
Yes, it is. We have an outstanding PR that we need to review.
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
andclass_out_count
dictionaries that will store per-class counts.API
Additional