From 68de79dbd5966149c1cb1df9af78eef324488f57 Mon Sep 17 00:00:00 2001 From: Muhammad Rizwan Munawar Date: Thu, 1 Feb 2024 23:47:58 +0500 Subject: [PATCH] Add https://youtu.be/96NkhsV-W1U to docs and `heatmaps` fix (#7944) Co-authored-by: UltralyticsAssistant Co-authored-by: Glenn Jocher --- docs/en/guides/index.md | 11 +++++++++++ ultralytics/solutions/heatmap.py | 3 ++- ultralytics/solutions/object_counter.py | 2 +- ultralytics/solutions/speed_estimation.py | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/docs/en/guides/index.md b/docs/en/guides/index.md index eddc443c..7df1c984 100644 --- a/docs/en/guides/index.md +++ b/docs/en/guides/index.md @@ -10,6 +10,17 @@ Welcome to the Ultralytics' YOLO 🚀 Guides! Our comprehensive tutorials cover Whether you're a beginner or an expert in deep learning, our tutorials offer valuable insights into the implementation and optimization of YOLO for your computer vision projects. Let's dive in! +

+
+ +
+ Watch: Ultralytics YOLOv8 Guides Overview +

+ ## Guides Here's a compilation of in-depth guides to help you master different aspects of Ultralytics YOLO. diff --git a/ultralytics/solutions/heatmap.py b/ultralytics/solutions/heatmap.py index e4e7e9be..f70e62bb 100644 --- a/ultralytics/solutions/heatmap.py +++ b/ultralytics/solutions/heatmap.py @@ -167,9 +167,10 @@ class Heatmap: """ self.im0 = im0 if tracks[0].boxes.id is None: + self.heatmap = np.zeros((int(self.imh), int(self.imw)), dtype=np.float32) if self.view_img and self.env_check: self.display_frames() - return + return im0 self.heatmap *= self.decay_factor # decay factor self.extract_results(tracks) self.annotator = Annotator(self.im0, self.count_txt_thickness, None) diff --git a/ultralytics/solutions/object_counter.py b/ultralytics/solutions/object_counter.py index e06c5a25..37ac7a2b 100644 --- a/ultralytics/solutions/object_counter.py +++ b/ultralytics/solutions/object_counter.py @@ -256,7 +256,7 @@ class ObjectCounter: if tracks[0].boxes.id is None: if self.view_img: self.display_frames() - return + return im0 self.extract_and_process_tracks(tracks) if self.view_img: diff --git a/ultralytics/solutions/speed_estimation.py b/ultralytics/solutions/speed_estimation.py index 52ce7dae..af17392a 100644 --- a/ultralytics/solutions/speed_estimation.py +++ b/ultralytics/solutions/speed_estimation.py @@ -164,7 +164,7 @@ class SpeedEstimator: if tracks[0].boxes.id is None: if self.view_img and self.env_check: self.display_frames() - return + return im0 self.extract_tracks(tracks) self.annotator = Annotator(self.im0, line_width=2)