y
File size: 453 Bytes
94c42be
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import requests
import os.path

def weights():

    path = 'models/yolov7.pt'

    check_file = os.path.isfile(path)

    if check_file == True:
        pass
    else:
        URL = "https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7.pt"
        response = requests.get(URL)
        open(path, "wb").write(response.content)

if __name__ == "__main__":
    try:
        weights()
    except Exception as e:
        print(f'error is {e}')