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:
parent
6e660dfaaf
commit
412eb57fca
12 changed files with 60 additions and 22 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
import cv2
|
||||
|
||||
from ultralytics.utils.checks import check_imshow
|
||||
from ultralytics.utils.plotting import Annotator
|
||||
|
||||
|
||||
|
|
@ -32,6 +33,9 @@ class AIGym:
|
|||
self.view_img = False
|
||||
self.annotator = None
|
||||
|
||||
# Check if environment support imshow
|
||||
self.env_check = check_imshow(warn=True)
|
||||
|
||||
def set_args(self,
|
||||
kpts_to_check,
|
||||
line_thickness=2,
|
||||
|
|
@ -120,7 +124,7 @@ class AIGym:
|
|||
|
||||
self.annotator.kpts(k, shape=(640, 640), radius=1, kpt_line=True)
|
||||
|
||||
if self.view_img:
|
||||
if self.env_check and self.view_img:
|
||||
cv2.imshow('Ultralytics YOLOv8 AI GYM', self.im0)
|
||||
if cv2.waitKey(1) & 0xFF == ord('q'):
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue