Ultralytics Code Refactor https://ultralytics.com/actions (#16940)
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
0027e0837c
commit
a622b404ef
19 changed files with 32 additions and 33 deletions
|
|
@ -61,11 +61,11 @@ class Analytics(BaseSolution):
|
|||
self.extract_tracks(im0) # Extract tracks
|
||||
|
||||
if self.type == "line":
|
||||
for box in self.boxes:
|
||||
for _ in self.boxes:
|
||||
self.total_counts += 1
|
||||
im0 = self.update_graph(frame_number=frame_number)
|
||||
self.total_counts = 0
|
||||
elif self.type == "pie" or self.type == "bar" or self.type == "area":
|
||||
elif self.type in {"pie", "bar", "area"}:
|
||||
self.clswise_count = {}
|
||||
for box, cls in zip(self.boxes, self.clss):
|
||||
if self.names[int(cls)] in self.clswise_count:
|
||||
|
|
|
|||
|
|
@ -52,7 +52,8 @@ class Heatmap(ObjectCounter):
|
|||
Returns:
|
||||
im0 (ndarray): Processed image for further usage
|
||||
"""
|
||||
self.heatmap = np.zeros_like(im0, dtype=np.float32) * 0.99 if not self.initialized else self.heatmap
|
||||
if not self.initialized:
|
||||
self.heatmap = np.zeros_like(im0, dtype=np.float32) * 0.99
|
||||
self.initialized = True # Initialize heatmap only once
|
||||
|
||||
self.annotator = Annotator(im0, line_width=self.line_width) # Initialize annotator
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue