ultralytics 8.0.108 add Meituan YOLOv6 models (#2811)

Co-authored-by: Michael Currie <mcurrie@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Hicham Talaoubrid <98521878+HichTala@users.noreply.github.com>
Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com>
Co-authored-by: Szymon Mikler <sjmikler@gmail.com>
This commit is contained in:
Glenn Jocher 2023-05-25 00:43:32 +02:00 committed by GitHub
parent 07b57c03c8
commit ffc0e8ccf7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 233 additions and 45 deletions

View file

@ -372,12 +372,15 @@ def is_online() -> bool:
"""
import socket
for server in '1.1.1.1', '8.8.8.8', '223.5.5.5': # Cloudflare, Google, AliDNS:
for host in '1.1.1.1', '8.8.8.8', '223.5.5.5': # Cloudflare, Google, AliDNS:
try:
socket.create_connection((server, 53), timeout=2) # connect to (server, port=53)
return True
test_connection = socket.create_connection(address=(host, 53), timeout=2)
except (socket.timeout, socket.gaierror, OSError):
continue
else:
# If the connection was successful, close it to avoid a ResourceWarning
test_connection.close()
return True
return False