ultralytics 8.0.86 HUB resume, Classify train and RayTune fixes (#2200)

Co-authored-by: Ayush Chaurasia <ayush.chaurarsia@gmail.com>
This commit is contained in:
Glenn Jocher
2023-04-23 15:28:22 +02:00
committed by GitHub
parent 283e334bd4
commit 3d60347755
10 changed files with 52 additions and 26 deletions

View File

@ -2,6 +2,7 @@
import os
import platform
import random
import sys
import threading
import time
@ -147,7 +148,7 @@ class Events:
disabled when sync=False. Run 'yolo settings' to see and update settings YAML file.
Attributes:
url (str): The GA4 Measurement Protocol URL.
url (str): The URL to send anonymous events.
rate_limit (float): The rate limit in seconds for sending events.
metadata (dict): A dictionary containing metadata about the environment.
enabled (bool): A flag to enable or disable Events based on certain conditions.
@ -165,9 +166,11 @@ class Events:
self.metadata = {
'cli': Path(sys.argv[0]).name == 'yolo',
'install': 'git' if is_git_dir() else 'pip' if is_pip_package() else 'other',
'python': platform.python_version(),
'python': '.'.join(platform.python_version_tuple()[:2]), # i.e. 3.10
'version': __version__,
'env': ENVIRONMENT}
'env': ENVIRONMENT,
'session_id': round(random.random() * 1E15),
'engagement_time_msec': 1000}
self.enabled = \
SETTINGS['sync'] and \
RANK in (-1, 0) and \
@ -180,7 +183,7 @@ class Events:
Attempts to add a new event to the events list and send events if the rate limit is reached.
Args:
cfg: The configuration object containing mode and task information.
cfg (IterableSimpleNamespace): The configuration object containing mode and task information.
"""
if not self.enabled:
# Events disabled, do nothing