Commit 842c39f 1 parent 50056d4 commit 842c39f Copy full SHA for 842c39f
File tree 1 file changed +17
-0
lines changed
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 5
5
6
6
7
7
class Yolov5TestConstants :
8
+ YOLOV5N_MODEL_URL = "https://github.com/ultralytics/yolov5/releases/download/v6.0/yolov5n.pt"
9
+ YOLOV5N_MODEL_PATH = "tests/data/models/yolov5/yolov5n.pt"
10
+
8
11
YOLOV5S6_MODEL_URL = "https://github.com/ultralytics/yolov5/releases/download/v5.0/yolov5s6.pt"
9
12
YOLOV5S6_MODEL_PATH = "tests/data/models/yolov5/yolov5s6.pt"
10
13
11
14
YOLOV5M6_MODEL_URL = "https://github.com/ultralytics/yolov5/releases/download/v5.0/yolov5m6.pt"
12
15
YOLOV5M6_MODEL_PATH = "tests/data/models/yolov5/yolov5m6.pt"
13
16
14
17
18
+ def download_yolov5n_model (destination_path : Optional [str ] = None ):
19
+
20
+ if destination_path is None :
21
+ destination_path = Yolov5TestConstants .YOLOV5N_MODEL_PATH
22
+
23
+ Path (destination_path ).parent .mkdir (parents = True , exist_ok = True )
24
+
25
+ if not path .exists (destination_path ):
26
+ urllib .request .urlretrieve (
27
+ Yolov5TestConstants .YOLOV5N_MODEL_URL ,
28
+ destination_path ,
29
+ )
30
+
31
+
15
32
def download_yolov5s6_model (destination_path : Optional [str ] = None ):
16
33
17
34
if destination_path is None :
You can’t perform that action at this time.
0 commit comments