Fix for Arial.ttf redownloads with hub inference (#4627)
Browse files- utils/__init__.py +3 -0
utils/__init__.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
from pathlib import Path
|
2 |
|
3 |
import torch
|
@@ -5,6 +6,8 @@ from PIL import ImageFont
|
|
5 |
|
6 |
FILE = Path(__file__).absolute()
|
7 |
ROOT = FILE.parents[1] # yolov5/ dir
|
|
|
|
|
8 |
|
9 |
# Check YOLOv5 Annotator font
|
10 |
font = 'Arial.ttf'
|
|
|
1 |
+
import sys
|
2 |
from pathlib import Path
|
3 |
|
4 |
import torch
|
|
|
6 |
|
7 |
FILE = Path(__file__).absolute()
|
8 |
ROOT = FILE.parents[1] # yolov5/ dir
|
9 |
+
if str(ROOT) not in sys.path:
|
10 |
+
sys.path.append(str(ROOT)) # add ROOT to PATH
|
11 |
|
12 |
# Check YOLOv5 Annotator font
|
13 |
font = 'Arial.ttf'
|