mirror of
https://github.com/WongKinYiu/yolov7.git
synced 2025-06-03 21:54:57 +08:00
main code
update link
This commit is contained in:
parent
54627aa3ac
commit
b1a23d4938
@ -16,17 +16,17 @@ def gsutil_getsize(url=''):
|
|||||||
return eval(s.split(' ')[0]) if len(s) else 0 # bytes
|
return eval(s.split(' ')[0]) if len(s) else 0 # bytes
|
||||||
|
|
||||||
|
|
||||||
def attempt_download(file, repo='WongKinYiu/yolov6'):
|
def attempt_download(file, repo='WongKinYiu/yolov7'):
|
||||||
# Attempt file download if does not exist
|
# Attempt file download if does not exist
|
||||||
file = Path(str(file).strip().replace("'", '').lower())
|
file = Path(str(file).strip().replace("'", '').lower())
|
||||||
|
|
||||||
if not file.exists():
|
if not file.exists():
|
||||||
try:
|
try:
|
||||||
response = requests.get(f'https://api.github.com/repos/{repo}/releases/weights').json() # github api
|
response = requests.get(f'https://api.github.com/repos/{repo}/releases/latest').json() # github api
|
||||||
assets = [x['name'] for x in response['assets']] # release assets
|
assets = [x['name'] for x in response['assets']] # release assets
|
||||||
tag = response['tag_name'] # i.e. 'v1.0'
|
tag = response['tag_name'] # i.e. 'v1.0'
|
||||||
except: # fallback plan
|
except: # fallback plan
|
||||||
assets = ['yolov6.pt']
|
assets = ['yolov7.pt']
|
||||||
tag = subprocess.check_output('git tag', shell=True).decode().split()[-1]
|
tag = subprocess.check_output('git tag', shell=True).decode().split()[-1]
|
||||||
|
|
||||||
name = file.name
|
name = file.name
|
||||||
@ -53,7 +53,7 @@ def attempt_download(file, repo='WongKinYiu/yolov6'):
|
|||||||
|
|
||||||
|
|
||||||
def gdrive_download(id='', file='tmp.zip'):
|
def gdrive_download(id='', file='tmp.zip'):
|
||||||
# Downloads a file from Google Drive. from yolov6.utils.google_utils import *; gdrive_download()
|
# Downloads a file from Google Drive. from yolov7.utils.google_utils import *; gdrive_download()
|
||||||
t = time.time()
|
t = time.time()
|
||||||
file = Path(file)
|
file = Path(file)
|
||||||
cookie = Path('cookie') # gdrive cookie
|
cookie = Path('cookie') # gdrive cookie
|
||||||
|
Loading…
x
Reference in New Issue
Block a user