Spaces:
Build error
Build error
Update utils.py
Browse files
utils.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import cv2
|
2 |
import torch
|
3 |
from urllib.request import urlretrieve
|
@@ -26,6 +27,9 @@ def accuracy(predictions, ground_truth):
|
|
26 |
return score.item()
|
27 |
|
28 |
def download_weights(url):
|
|
|
29 |
fname = url.split('/')[-1]
|
30 |
-
|
|
|
|
|
31 |
return fname
|
|
|
1 |
+
import os
|
2 |
import cv2
|
3 |
import torch
|
4 |
from urllib.request import urlretrieve
|
|
|
27 |
return score.item()
|
28 |
|
29 |
def download_weights(url):
|
30 |
+
cd = os.getcwd()
|
31 |
fname = url.split('/')[-1]
|
32 |
+
fname = os.path.join(cd, fname)
|
33 |
+
if not os.path.exists(fname):
|
34 |
+
urlretrieve(url, fname)
|
35 |
return fname
|