Fix for Arial.ttf redownloads with hub inference (#4627)

pull/4628/head
Glenn Jocher 2021-08-31 15:01:41 +02:00 committed by GitHub
parent 50a9828679
commit ba0f80874f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -1,3 +1,4 @@
import sys
from pathlib import Path
import torch
@ -5,6 +6,8 @@ from PIL import ImageFont
FILE = Path(__file__).absolute()
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
font = 'Arial.ttf'