Spaces:
Runtime error
Runtime error
Daryl Fung
commited on
Commit
·
5c0d0b9
1
Parent(s):
a38664e
fix plot
Browse files- yolov5/utils/plots.py +8 -8
yolov5/utils/plots.py
CHANGED
@@ -52,14 +52,14 @@ def check_pil_font(font=FONT, size=10):
|
|
52 |
# Return a PIL TrueType Font, downloading to CONFIG_DIR if necessary
|
53 |
font = Path(font)
|
54 |
font = font if font.exists() else (CONFIG_DIR / font.name)
|
55 |
-
try:
|
56 |
-
|
57 |
-
except Exception: # download if missing
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
|
64 |
|
65 |
class Annotator:
|
|
|
52 |
# Return a PIL TrueType Font, downloading to CONFIG_DIR if necessary
|
53 |
font = Path(font)
|
54 |
font = font if font.exists() else (CONFIG_DIR / font.name)
|
55 |
+
# try:
|
56 |
+
return ImageFont.load_default() # ImageFont.truetype(str(font) if font.exists() else font.name, size)
|
57 |
+
# except Exception: # download if missing
|
58 |
+
# check_font(font)
|
59 |
+
# try:
|
60 |
+
# return ImageFont.truetype(str(font), size)
|
61 |
+
# except TypeError:
|
62 |
+
# check_requirements('Pillow>=8.4.0') # known issue https://github.com/ultralytics/yolov5/issues/5374
|
63 |
|
64 |
|
65 |
class Annotator:
|