ultralytics 8.1.0 YOLOv8 Oriented Bounding Box (OBB) release (#7463)

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
Co-authored-by: Laughing <61612323+Laughing-q@users.noreply.github.com>
Co-authored-by: Yakuho <Yakuho@foxmail.com>
Co-authored-by: Oran <75175510+Acenath@users.noreply.github.com>
This commit is contained in:
Glenn Jocher 2024-01-10 10:57:40 +01:00 committed by GitHub
parent 54e61963c8
commit 808984c6cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
95 changed files with 787 additions and 752 deletions

View file

@ -397,7 +397,7 @@ def get_github_assets(repo="ultralytics/assets", version="latest", retry=False):
return data["tag_name"], [x["name"] for x in data["assets"]] # tag, assets i.e. ['yolov8n.pt', 'yolov8s.pt', ...]
def attempt_download_asset(file, repo="ultralytics/assets", release="v0.0.0", **kwargs):
def attempt_download_asset(file, repo="ultralytics/assets", release="v8.1.0", **kwargs):
"""
Attempt to download a file from GitHub release assets if it is not found locally. The function checks for the file
locally first, then tries to download it from the specified GitHub repository release.
@ -405,7 +405,7 @@ def attempt_download_asset(file, repo="ultralytics/assets", release="v0.0.0", **
Args:
file (str | Path): The filename or file path to be downloaded.
repo (str, optional): The GitHub repository in the format 'owner/repo'. Defaults to 'ultralytics/assets'.
release (str, optional): The specific release version to be downloaded. Defaults to 'v0.0.0'.
release (str, optional): The specific release version to be downloaded. Defaults to 'v8.1.0'.
**kwargs (dict): Additional keyword arguments for the download process.
Returns:

View file

@ -23,22 +23,24 @@ class Profile(contextlib.ContextDecorator):
```python
from ultralytics.utils.ops import Profile
with Profile() as dt:
with Profile(device=device) as dt:
pass # slow operation here
print(dt) # prints "Elapsed time is 9.5367431640625e-07 s"
```
"""
def __init__(self, t=0.0):
def __init__(self, t=0.0, device: torch.device = None):
"""
Initialize the Profile class.
Args:
t (float): Initial time. Defaults to 0.0.
device (torch.device): Devices used for model inference. Defaults to None (cpu).
"""
self.t = t
self.cuda = torch.cuda.is_available()
self.device = device
self.cuda = True if (device and str(device)[:4] == "cuda") else False
def __enter__(self):
"""Start timing."""
@ -57,7 +59,7 @@ class Profile(contextlib.ContextDecorator):
def time(self):
"""Get current time."""
if self.cuda:
torch.cuda.synchronize()
torch.cuda.synchronize(self.device)
return time.time()