assets = [x["name"] for x in response["assets"]] // release assets ["yolov3.pt", "yolov3-spp.pt", "yolov3-tiny.pt"]
redundant = False // second download option
if file in assets and not os.path.isfile(weights):
try: // GitHub
tag = response["tag_name"] // i.e. "v1.0"
url = f"https://github.com/ultralytics/yolov3/releases/download/{tag}/{file}"
After Change
// Attempt file download if does not exist
file = Path(str(file).strip().replace(""", "").lower())
if not file.exists():
response = requests.get("https://api.github.com/repos/ultralytics/yolov3/releases/latest").json() // github api
assets = [x["name"] for x in response["assets"]] // release assets ["yolov3.pt", "yolov3-spp.pt", ...]
name = file.name
if name in assets:
msg = f"{file} missing, try downloading from https://github.com/ultralytics/yolov3/releases/"
redundant = False // second download option