ultralytics 8.2.54 resolve YouTube bug with switch to pytubefix (#14354)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
95736975fc
commit
5b330ad310
4 changed files with 12 additions and 16 deletions
19
.github/workflows/publish.yml
vendored
19
.github/workflows/publish.yml
vendored
|
|
@ -109,14 +109,13 @@ jobs:
|
||||||
response = requests.get(url, headers=headers)
|
response = requests.get(url, headers=headers)
|
||||||
diff = response.text if response.status_code == 200 else f"Failed to get diff: {response.content}"
|
diff = response.text if response.status_code == 200 else f"Failed to get diff: {response.content}"
|
||||||
|
|
||||||
# Set up OpenAI client
|
# Set up client
|
||||||
client = openai.AzureOpenAI(
|
client = openai.AzureOpenAI(
|
||||||
api_key=OPENAI_AZURE_API_KEY,
|
api_key=OPENAI_AZURE_API_KEY,
|
||||||
api_version=OPENAI_AZURE_API_VERSION,
|
api_version=OPENAI_AZURE_API_VERSION,
|
||||||
azure_endpoint=OPENAI_AZURE_ENDPOINT
|
azure_endpoint=OPENAI_AZURE_ENDPOINT
|
||||||
)
|
)
|
||||||
|
|
||||||
# Prepare messages for OpenAI completion
|
|
||||||
messages = [
|
messages = [
|
||||||
{
|
{
|
||||||
"role": "system",
|
"role": "system",
|
||||||
|
|
@ -125,19 +124,15 @@ jobs:
|
||||||
{
|
{
|
||||||
"role": "user",
|
"role": "user",
|
||||||
"content": f"Summarize the updates made in the [Ultralytics](https://ultralytics.com) '{latest_tag}' tag, focusing on major changes, their purpose, and potential impact. Keep the summary clear and suitable for a broad audience. Add emojis to enliven the summary. Reply directly with a summary along these example guidelines, though feel free to adjust as appropriate:\n\n"
|
"content": f"Summarize the updates made in the [Ultralytics](https://ultralytics.com) '{latest_tag}' tag, focusing on major changes, their purpose, and potential impact. Keep the summary clear and suitable for a broad audience. Add emojis to enliven the summary. Reply directly with a summary along these example guidelines, though feel free to adjust as appropriate:\n\n"
|
||||||
f"### 🌟 Summary (single-line synopsis)\n"
|
f"## 🌟 Summary (single-line synopsis)\n"
|
||||||
f"### 📊 Key Changes (bullet points highlighting any major changes)\n"
|
f"## 📊 Key Changes (bullet points highlighting any major changes)\n"
|
||||||
f"### 🎯 Purpose & Impact (bullet points explaining any benefits and potential impact to users)\n"
|
f"## 🎯 Purpose & Impact (bullet points explaining any benefits and potential impact to users)\n"
|
||||||
f"\n\nHere's the release diff:\n\n{diff[:96000]}",
|
f"\n\nHere's the release diff:\n\n{diff[:300000]}",
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
try:
|
completion = client.chat.completions.create(model="gpt-4o-2024-05-13", messages=messages)
|
||||||
completion = client.chat.completions.create(model="gpt-4o-2024-05-13", messages=messages)
|
summary = completion.choices[0].message.content.strip()
|
||||||
summary = completion.choices[0].message.content.strip()
|
|
||||||
except openai.error.OpenAIError as e:
|
|
||||||
print(f"Failed to generate summary: {e}")
|
|
||||||
raise
|
|
||||||
|
|
||||||
# Get the latest commit message
|
# Get the latest commit message
|
||||||
commit_message = subprocess.run(['git', 'log', '-1', '--pretty=%B'], check=True, text=True, capture_output=True).stdout.split("\n")[0].strip()
|
commit_message = subprocess.run(['git', 'log', '-1', '--pretty=%B'], check=True, text=True, capture_output=True).stdout.split("\n")[0].strip()
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||||
|
|
||||||
__version__ = "8.2.53"
|
__version__ = "8.2.54"
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -544,8 +544,9 @@ def get_best_youtube_url(url, method="pytube"):
|
||||||
(str): The URL of the best quality MP4 video stream, or None if no suitable stream is found.
|
(str): The URL of the best quality MP4 video stream, or None if no suitable stream is found.
|
||||||
"""
|
"""
|
||||||
if method == "pytube":
|
if method == "pytube":
|
||||||
check_requirements("pytube")
|
# Switched from pytube to pytubefix to resolve https://github.com/pytube/pytube/issues/1954
|
||||||
from pytube import YouTube
|
check_requirements("pytubefix")
|
||||||
|
from pytubefix import YouTube
|
||||||
|
|
||||||
streams = YouTube(url).streams.filter(file_extension="mp4", only_video=True)
|
streams = YouTube(url).streams.filter(file_extension="mp4", only_video=True)
|
||||||
streams = sorted(streams, key=lambda s: s.resolution, reverse=True) # sort streams by resolution
|
streams = sorted(streams, key=lambda s: s.resolution, reverse=True) # sort streams by resolution
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ from ultralytics.utils import LOGGER, TQDM, checks, clean_url, emojis, is_online
|
||||||
# Define Ultralytics GitHub assets maintained at https://github.com/ultralytics/assets
|
# Define Ultralytics GitHub assets maintained at https://github.com/ultralytics/assets
|
||||||
GITHUB_ASSETS_REPO = "ultralytics/assets"
|
GITHUB_ASSETS_REPO = "ultralytics/assets"
|
||||||
GITHUB_ASSETS_NAMES = (
|
GITHUB_ASSETS_NAMES = (
|
||||||
[f"yolov8{k}{suffix}.pt" for k in "nsmlx" for suffix in ("", "-cls", "-seg", "-pose", "-obb")]
|
[f"yolov8{k}{suffix}.pt" for k in "nsmlx" for suffix in ("", "-cls", "-seg", "-pose", "-obb", "-oiv7")]
|
||||||
+ [f"yolov5{k}{resolution}u.pt" for k in "nsmlx" for resolution in ("", "6")]
|
+ [f"yolov5{k}{resolution}u.pt" for k in "nsmlx" for resolution in ("", "6")]
|
||||||
+ [f"yolov3{k}u.pt" for k in ("", "-spp", "-tiny")]
|
+ [f"yolov3{k}u.pt" for k in ("", "-spp", "-tiny")]
|
||||||
+ [f"yolov8{k}-world.pt" for k in "smlx"]
|
+ [f"yolov8{k}-world.pt" for k in "smlx"]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue