해결됨
[개정판] 딥러닝 컴퓨터 비전 완벽 가이드
font 에러 관련 질문 (for window 10, local)
detected_img = yolo.detect_image(img)
plt.imshow(detected_img) 의 코드를 실행하였더니 OSError가 발생합니다.
window10 환경인데 어떻게 해야
강의 폴더 내에 있는 FiraMono-Medium.otf를 인식시킬 수 있을까요?
(416, 416, 3)
Found 19 boxes for img
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
<ipython-input-34-4f14924e2a84> in <module>
----> 1 detected_img = yolo.detect_image(img)
2 plt.imshow(detected_img)
C:\JupyterNotebook\DLCV\Detection\yolo\keras-yolo3\yolo.py in detect_image(self, image)
128
129 font = ImageFont.truetype(font='font/FiraMono-Medium.otf',
--> 130 size=np.floor(3e-2 * image.size[1] + 0.5).astype('int32'))
131 thickness = (image.size[0] + image.size[1]) // 300
132
~\anaconda3\envs\tf115\lib\site-packages\PIL\ImageFont.py in truetype(font, size, index, encoding, layout_engine)
851
852 try:
--> 853 return freetype(font)
854 except OSError:
855 if not isPath(font):
~\anaconda3\envs\tf115\lib\site-packages\PIL\ImageFont.py in freetype(font)
848
849 def freetype(font):
--> 850 return FreeTypeFont(font, size, index, encoding, layout_engine)
851
852 try:
~\anaconda3\envs\tf115\lib\site-packages\PIL\ImageFont.py in __init__(self, font, size, index, encoding, layout_engine)
208 return
209 self.font = core.getfont(
--> 210 font, size, index, encoding, layout_engine=layout_engine
211 )
212 else:
OSError: cannot open resource