ultralytics 8.0.226 Validator Path and Tuner space (#6901)

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: Muhammad Rizwan Munawar <chr043416@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: DennisJ <106725464+DennisJcy@users.noreply.github.com>
Co-authored-by: Kirill Ionkin <56236621+kirill-ionkin@users.noreply.github.com>
This commit is contained in:
Glenn Jocher 2023-12-10 18:15:59 +01:00 committed by GitHub
parent 6e660dfaaf
commit 412eb57fca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 60 additions and 22 deletions

View file

@ -5,7 +5,7 @@ from collections import defaultdict
import cv2
import numpy as np
from ultralytics.utils.checks import check_requirements
from ultralytics.utils.checks import check_imshow, check_requirements
from ultralytics.utils.plotting import Annotator
check_requirements('shapely>=2.0.0')
@ -50,6 +50,9 @@ class Heatmap:
self.count_reg_color = (0, 255, 0)
self.region_thickness = 5
# Check if environment support imshow
self.env_check = check_imshow(warn=True)
def set_args(self,
imw,
imh,
@ -155,7 +158,7 @@ class Heatmap:
im0_with_heatmap = cv2.addWeighted(self.im0, 1 - self.heatmap_alpha, heatmap_colored, self.heatmap_alpha, 0)
if self.view_img:
if self.env_check and self.view_img:
self.display_frames(im0_with_heatmap)
return im0_with_heatmap