mirror of
https://github.com/THU-MIG/yolov10.git
synced 2025-05-23 21:44:22 +08:00
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>
This commit is contained in:
parent
6baa3bdde6
commit
d43fcecc8a
2
.github/dependabot.yml
vendored
2
.github/dependabot.yml
vendored
@ -16,7 +16,7 @@ updates:
|
|||||||
- dependencies
|
- dependencies
|
||||||
|
|
||||||
- package-ecosystem: github-actions
|
- package-ecosystem: github-actions
|
||||||
directory: "/"
|
directory: "/.github/workflows"
|
||||||
schedule:
|
schedule:
|
||||||
interval: weekly
|
interval: weekly
|
||||||
time: "04:00"
|
time: "04:00"
|
||||||
|
26
.github/translate-readme.yml
vendored
26
.github/translate-readme.yml
vendored
@ -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
|
|
39
.github/workflows/ci.yaml
vendored
39
.github/workflows/ci.yaml
vendored
@ -56,14 +56,6 @@ jobs:
|
|||||||
- name: Check environment
|
- name: Check environment
|
||||||
run: |
|
run: |
|
||||||
yolo checks
|
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
|
pip list
|
||||||
- name: Test HUB training
|
- name: Test HUB training
|
||||||
shell: python
|
shell: python
|
||||||
@ -123,14 +115,6 @@ jobs:
|
|||||||
- name: Check environment
|
- name: Check environment
|
||||||
run: |
|
run: |
|
||||||
yolo checks
|
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
|
pip list
|
||||||
# - name: Benchmark DetectionModel
|
# - name: Benchmark DetectionModel
|
||||||
# shell: bash
|
# shell: bash
|
||||||
@ -191,14 +175,6 @@ jobs:
|
|||||||
- name: Check environment
|
- name: Check environment
|
||||||
run: |
|
run: |
|
||||||
yolo checks
|
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
|
pip list
|
||||||
- name: Pytest tests
|
- name: Pytest tests
|
||||||
shell: bash # for Windows compatibility
|
shell: bash # for Windows compatibility
|
||||||
@ -228,14 +204,6 @@ jobs:
|
|||||||
- name: Check environment
|
- name: Check environment
|
||||||
run: |
|
run: |
|
||||||
yolo checks
|
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
|
pip list
|
||||||
- name: Pytest tests
|
- name: Pytest tests
|
||||||
run: pytest --cov=ultralytics/ --cov-report xml tests/test_cuda.py
|
run: pytest --cov=ultralytics/ --cov-report xml tests/test_cuda.py
|
||||||
@ -276,13 +244,6 @@ jobs:
|
|||||||
pip install pytest 'coremltools>=7.0'
|
pip install pytest 'coremltools>=7.0'
|
||||||
- name: Check environment
|
- name: Check environment
|
||||||
run: |
|
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
|
conda list
|
||||||
- name: Test CLI
|
- name: Test CLI
|
||||||
run: |
|
run: |
|
||||||
|
@ -155,7 +155,6 @@ def test_track_stream():
|
|||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
model = YOLO(MODEL)
|
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='bytetrack.yaml')
|
||||||
model.track('https://ultralytics.com/assets/decelera_portrait_min.mov', imgsz=160, tracker='botsort.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
|
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||||
|
|
||||||
__version__ = '8.0.213'
|
__version__ = '8.0.214'
|
||||||
|
|
||||||
from ultralytics.models import RTDETR, SAM, YOLO
|
from ultralytics.models import RTDETR, SAM, YOLO
|
||||||
from ultralytics.models.fastsam import FastSAM
|
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
|
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
|
# Configure the console (stdout) encoding to UTF-8
|
||||||
if WINDOWS: # for Windows
|
if WINDOWS and sys.stdout.encoding != 'utf-8':
|
||||||
sys.stdout.reconfigure(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
|
# Create and configure the StreamHandler
|
||||||
stream_handler = logging.StreamHandler(sys.stdout)
|
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)
|
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:
|
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():
|
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
|
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 \
|
ENVIRONMENT = 'Colab' if is_colab() else 'Kaggle' if is_kaggle() else 'Jupyter' if is_jupyter() else \
|
||||||
'Docker' if is_docker() else platform.system()
|
'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()
|
set_sentry()
|
||||||
|
|
||||||
# Apply monkey patches
|
# 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,
|
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,
|
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=''):
|
def parse_requirements(file_path=ROOT.parent / 'requirements.txt', package=''):
|
||||||
@ -552,6 +552,14 @@ def collect_system_info():
|
|||||||
is_met = '❌ '
|
is_met = '❌ '
|
||||||
LOGGER.info(f'{r.name:<20}{is_met}{current}{r.specifier}')
|
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):
|
def check_amp(model):
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user