Fix Arial.ttf threaded multi-download bug (#3725)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Glenn Jocher 2023-07-13 18:56:10 +02:00 committed by GitHub
parent 9aca61c465
commit fadbef84e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 3 deletions

View file

@ -20,9 +20,9 @@ import requests
import torch
from matplotlib import font_manager
from ultralytics.yolo.utils import (AUTOINSTALL, LOGGER, ONLINE, ROOT, USER_CONFIG_DIR, TryExcept, clean_url, colorstr,
downloads, emojis, is_colab, is_docker, is_jupyter, is_kaggle, is_online,
is_pip_package, url2file)
from ultralytics.yolo.utils import (AUTOINSTALL, LOGGER, ONLINE, ROOT, USER_CONFIG_DIR, ThreadingLocked, TryExcept,
clean_url, colorstr, downloads, emojis, is_colab, is_docker, is_jupyter, is_kaggle,
is_online, is_pip_package, url2file)
def is_ascii(s) -> bool:
@ -155,6 +155,7 @@ def check_pip_update_available():
return False
@ThreadingLocked()
def check_font(font='Arial.ttf'):
"""
Find font locally or download to user's configuration directory if it does not already exist.