`ultralytics 8.0.214` Windows UTF-8 notebook fix (#6459)

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Jorge Torres <63155200+JorgeT42@users.noreply.github.com>
Co-authored-by: slxiu <121917717+slxiu@users.noreply.github.com>
pull/6466/head v8.0.214
Glenn Jocher 1 year ago committed by GitHub
parent 6baa3bdde6
commit d43fcecc8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .github/dependabot.yml
  2. 26
      .github/translate-readme.yml
  3. 39
      .github/workflows/ci.yaml
  4. 1
      tests/test_python.py
  5. 2
      ultralytics/__init__.py
  6. 21
      ultralytics/utils/__init__.py
  7. 10
      ultralytics/utils/checks.py

@ -16,7 +16,7 @@ updates:
- dependencies
- package-ecosystem: github-actions
directory: "/"
directory: "/.github/workflows"
schedule:
interval: weekly
time: "04:00"

@ -1,26 +0,0 @@
# Ultralytics YOLO 🚀, AGPL-3.0 license
# README translation action to translate README.md to Chinese as README.zh-CN.md on any change to README.md
name: Translate README
on:
push:
branches:
- translate_readme # replace with 'main' to enable action
paths:
- README.md
jobs:
Translate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16
# ISO Language Codes: https://cloud.google.com/translate/docs/languages
- name: Adding README - Chinese Simplified
uses: dephraiim/translate-readme@main
with:
LANG: zh-CN

@ -56,14 +56,6 @@ jobs:
- name: Check environment
run: |
yolo checks
echo "RUNNER_OS is ${{ runner.os }}"
echo "GITHUB_EVENT_NAME is ${{ github.event_name }}"
echo "GITHUB_WORKFLOW is ${{ github.workflow }}"
echo "GITHUB_ACTOR is ${{ github.actor }}"
echo "GITHUB_REPOSITORY is ${{ github.repository }}"
echo "GITHUB_REPOSITORY_OWNER is ${{ github.repository_owner }}"
python --version
pip --version
pip list
- name: Test HUB training
shell: python
@ -123,14 +115,6 @@ jobs:
- name: Check environment
run: |
yolo checks
echo "RUNNER_OS is ${{ runner.os }}"
echo "GITHUB_EVENT_NAME is ${{ github.event_name }}"
echo "GITHUB_WORKFLOW is ${{ github.workflow }}"
echo "GITHUB_ACTOR is ${{ github.actor }}"
echo "GITHUB_REPOSITORY is ${{ github.repository }}"
echo "GITHUB_REPOSITORY_OWNER is ${{ github.repository_owner }}"
python --version
pip --version
pip list
# - name: Benchmark DetectionModel
# shell: bash
@ -191,14 +175,6 @@ jobs:
- name: Check environment
run: |
yolo checks
echo "RUNNER_OS is ${{ runner.os }}"
echo "GITHUB_EVENT_NAME is ${{ github.event_name }}"
echo "GITHUB_WORKFLOW is ${{ github.workflow }}"
echo "GITHUB_ACTOR is ${{ github.actor }}"
echo "GITHUB_REPOSITORY is ${{ github.repository }}"
echo "GITHUB_REPOSITORY_OWNER is ${{ github.repository_owner }}"
python --version
pip --version
pip list
- name: Pytest tests
shell: bash # for Windows compatibility
@ -228,14 +204,6 @@ jobs:
- name: Check environment
run: |
yolo checks
echo "RUNNER_OS is ${{ runner.os }}"
echo "GITHUB_EVENT_NAME is ${{ github.event_name }}"
echo "GITHUB_WORKFLOW is ${{ github.workflow }}"
echo "GITHUB_ACTOR is ${{ github.actor }}"
echo "GITHUB_REPOSITORY is ${{ github.repository }}"
echo "GITHUB_REPOSITORY_OWNER is ${{ github.repository_owner }}"
python --version
pip --version
pip list
- name: Pytest tests
run: pytest --cov=ultralytics/ --cov-report xml tests/test_cuda.py
@ -276,13 +244,6 @@ jobs:
pip install pytest 'coremltools>=7.0'
- name: Check environment
run: |
echo "RUNNER_OS is ${{ runner.os }}"
echo "GITHUB_EVENT_NAME is ${{ github.event_name }}"
echo "GITHUB_WORKFLOW is ${{ github.workflow }}"
echo "GITHUB_ACTOR is ${{ github.actor }}"
echo "GITHUB_REPOSITORY is ${{ github.repository }}"
echo "GITHUB_REPOSITORY_OWNER is ${{ github.repository_owner }}"
python --version
conda list
- name: Test CLI
run: |

@ -155,7 +155,6 @@ def test_track_stream():
import yaml
model = YOLO(MODEL)
model.predict('https://youtu.be/G17sBkb38XQ', imgsz=96, save=True)
model.track('https://ultralytics.com/assets/decelera_portrait_min.mov', imgsz=160, tracker='bytetrack.yaml')
model.track('https://ultralytics.com/assets/decelera_portrait_min.mov', imgsz=160, tracker='botsort.yaml')

@ -1,6 +1,6 @@
# Ultralytics YOLO 🚀, AGPL-3.0 license
__version__ = '8.0.213'
__version__ = '8.0.214'
from ultralytics.models import RTDETR, SAM, YOLO
from ultralytics.models.fastsam import FastSAM

@ -229,8 +229,15 @@ def set_logging(name=LOGGING_NAME, verbose=True):
level = logging.INFO if verbose and RANK in {-1, 0} else logging.ERROR # rank in world for Multi-GPU trainings
# Configure the console (stdout) encoding to UTF-8
if WINDOWS: # for Windows
sys.stdout.reconfigure(encoding='utf-8')
if WINDOWS and sys.stdout.encoding != 'utf-8':
try:
if hasattr(sys.stdout, 'reconfigure'):
sys.stdout.reconfigure(encoding='utf-8')
else:
import io
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
except Exception as e:
print(f'ERROR setting UTF-8 encoding: {e}')
# Create and configure the StreamHandler
stream_handler = logging.StreamHandler(sys.stdout)
@ -501,14 +508,14 @@ def is_pytest_running():
return ('PYTEST_CURRENT_TEST' in os.environ) or ('pytest' in sys.modules) or ('pytest' in Path(sys.argv[0]).stem)
def is_github_actions_ci() -> bool:
def is_github_action_running() -> bool:
"""
Determine if the current environment is a GitHub Actions CI Python runner.
Determine if the current environment is a GitHub Actions runner.
Returns:
(bool): True if the current environment is a GitHub Actions CI Python runner, False otherwise.
(bool): True if the current environment is a GitHub Actions runner, False otherwise.
"""
return 'GITHUB_ACTIONS' in os.environ and 'RUNNER_OS' in os.environ and 'RUNNER_TOOL_CACHE' in os.environ
return 'GITHUB_ACTIONS' in os.environ and 'GITHUB_WORKFLOW' in os.environ and 'RUNNER_OS' in os.environ
def is_git_dir():
@ -913,7 +920,7 @@ WEIGHTS_DIR = Path(SETTINGS['weights_dir']) # global weights directory
RUNS_DIR = Path(SETTINGS['runs_dir']) # global runs directory
ENVIRONMENT = 'Colab' if is_colab() else 'Kaggle' if is_kaggle() else 'Jupyter' if is_jupyter() else \
'Docker' if is_docker() else platform.system()
TESTS_RUNNING = is_pytest_running() or is_github_actions_ci()
TESTS_RUNNING = is_pytest_running() or is_github_action_running()
set_sentry()
# Apply monkey patches

@ -23,7 +23,7 @@ from matplotlib import font_manager
from ultralytics.utils import (ASSETS, AUTOINSTALL, LINUX, LOGGER, ONLINE, ROOT, USER_CONFIG_DIR, SimpleNamespace,
ThreadingLocked, TryExcept, clean_url, colorstr, downloads, emojis, is_colab, is_docker,
is_jupyter, is_kaggle, is_online, is_pip_package, url2file)
is_github_action_running, is_jupyter, is_kaggle, is_online, is_pip_package, url2file)
def parse_requirements(file_path=ROOT.parent / 'requirements.txt', package=''):
@ -552,6 +552,14 @@ def collect_system_info():
is_met = ''
LOGGER.info(f'{r.name:<20}{is_met}{current}{r.specifier}')
if is_github_action_running():
LOGGER.info(f"\nRUNNER_OS: {os.getenv('RUNNER_OS')}\n"
f"GITHUB_EVENT_NAME: {os.getenv('GITHUB_EVENT_NAME')}\n"
f"GITHUB_WORKFLOW: {os.getenv('GITHUB_WORKFLOW')}\n"
f"GITHUB_ACTOR: {os.getenv('GITHUB_ACTOR')}\n"
f"GITHUB_REPOSITORY: {os.getenv('GITHUB_REPOSITORY')}\n"
f"GITHUB_REPOSITORY_OWNER: {os.getenv('GITHUB_REPOSITORY_OWNER')}\n")
def check_amp(model):
"""

Loading…
Cancel
Save