PyUpgrade 3.8 updates (#15941)

Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
Glenn Jocher 2024-09-01 17:45:38 +02:00 committed by GitHub
parent ea13dc6208
commit 9ec8e9acbf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 25 additions and 25 deletions

View file

@ -198,7 +198,7 @@ class RF100Benchmark:
os.mkdir("ultralytics-benchmarks")
safe_download("https://github.com/ultralytics/assets/releases/download/v0.0.0/datasets_links.txt")
with open(ds_link_txt, "r") as file:
with open(ds_link_txt) as file:
for line in file:
try:
_, url, workspace, project, version = re.split("/+", line.strip())
@ -222,7 +222,7 @@ class RF100Benchmark:
Args:
path (str): YAML file path.
"""
with open(path, "r") as file:
with open(path) as file:
yaml_data = yaml.safe_load(file)
yaml_data["train"] = "train/images"
yaml_data["val"] = "valid/images"
@ -242,7 +242,7 @@ class RF100Benchmark:
skip_symbols = ["🚀", "⚠️", "💡", ""]
with open(yaml_path) as stream:
class_names = yaml.safe_load(stream)["names"]
with open(val_log_file, "r", encoding="utf-8") as f:
with open(val_log_file, encoding="utf-8") as f:
lines = f.readlines()
eval_lines = []
for line in lines: