Fix for Arial.ttf redownloads with hub inference (#4627)
This commit is contained in:
1 parent
50a9828679
commit
ba0f80874f
1 file changed
+3
@@ -1,3 +1,4 @@
|
|||||||
|
import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import torch
|
import torch
|
||||||
@@ -5,6 +6,8 @@ from PIL import ImageFont
|
|||||||
|
|
||||||
FILE = Path(__file__).absolute()
|
FILE = Path(__file__).absolute()
|
||||||
ROOT = FILE.parents[1] # yolov5/ dir
|
ROOT = FILE.parents[1] # yolov5/ dir
|
||||||
|
if str(ROOT) not in sys.path:
|
||||||
|
sys.path.append(str(ROOT)) # add ROOT to PATH
|
||||||
|
|
||||||
# Check YOLOv5 Annotator font
|
# Check YOLOv5 Annotator font
|
||||||
font = 'Arial.ttf'
|
font = 'Arial.ttf'
|
||||||
|
|||||||
Reference in new issue
Block a user