Automatic Chinese fonts plotting (#4951)

* Automatic Chinese fonts plotting

* Default PIL=False
This commit is contained in:
Glenn Jocher authored and GitHub committed 2021-09-27 13:48:15 -07:00
1 parent c5ba2abb4a
commit a820b43aca
4 files changed
+18 -20

No files matched your search

+2 -3
View File
@@ -23,7 +23,7 @@ if str(ROOT) not in sys.path:
from models.experimental import attempt_load
from utils.datasets import LoadImages, LoadStreams
from utils.general import apply_classifier, check_img_size, check_imshow, check_requirements, check_suffix, colorstr, \
increment_path, is_ascii, non_max_suppression, print_args, save_one_box, scale_coords, set_logging, \
increment_path, non_max_suppression, print_args, save_one_box, scale_coords, set_logging, \
strip_optimizer, xyxy2xywh
from utils.plots import Annotator, colors
from utils.torch_utils import load_classifier, select_device, time_sync
@@ -108,7 +108,6 @@ def run(weights='yolov5s.pt', # model.pt path(s)
output_details = interpreter.get_output_details() # outputs
int8 = input_details[0]['dtype'] == np.uint8 # is TFLite quantized uint8 model
imgsz = check_img_size(imgsz, s=stride) # check image size
ascii = is_ascii(names) # names are ascii (use PIL for UTF-8)
# Dataloader
if webcam:
@@ -190,7 +189,7 @@ def run(weights='yolov5s.pt', # model.pt path(s)
s += '%gx%g ' % img.shape[2:] # print string
gn = torch.tensor(im0.shape)[[1, 0, 1, 0]] # normalization gain whwh
imc = im0.copy() if save_crop else im0 # for save_crop
annotator = Annotator(im0, line_width=line_thickness, pil=not ascii)
annotator = Annotator(im0, line_width=line_thickness, example=str(names))
if len(det):
# Rescale boxes from img_size to im0 size
det[:, :4] = scale_coords(img.shape[2:], det[:, :4], im0.shape).round()