MrPose icon indicating copy to clipboard operation
MrPose copied to clipboard

Cannot Load ImageFonts

Open surpol opened this issue 2 years ago • 1 comments

INPUT: python3 mrpose.py --video /Users/surya/desktop/pexels-yaroslav-shuraev-8472764-3840x2160-25fps.mp4 --exercise pushup

Output: INFO: Created TensorFlow Lite XNNPACK delegate for CPU. Traceback (most recent call last): File "/Users/surya/Desktop/MrPose/mrpose.py", line 16, in pose.estimate_exercise() File "/Users/surya/Desktop/MrPose/utils/exercise_utils.py", line 17, in estimate_exercise pose_estimator = pose_estimator(self.video_reader) File "/Users/surya/Desktop/MrPose/utils/pose_utils/pose.py", line 277, in init super().init(video_reader) File "/Users/surya/Desktop/MrPose/utils/pose_utils/pose.py", line 31, in init self.draw = Draw(self.width, self.height) File "/Users/surya/Desktop/MrPose/utils/drawing_utils.py", line 15, in init self.font = ImageFont.truetype('../data/fonts/arial.ttf', self.height//24, encoding="unic") File "/Users/surya/Library/Python/3.9/lib/python/site-packages/PIL/ImageFont.py", line 996, in truetype return freetype(font) File "/Users/surya/Library/Python/3.9/lib/python/site-packages/PIL/ImageFont.py", line 993, in freetype return FreeTypeFont(font, size, index, encoding, layout_engine) File "/Users/surya/Library/Python/3.9/lib/python/site-packages/PIL/ImageFont.py", line 248, in init self.font = core.getfont( OSError: cannot open resource

surpol avatar Jun 21 '23 02:06 surpol

Go into the drawing_utils.py and change the line 15 to

self.font = ImageFont.load_default()

speed8928 avatar Jun 23 '23 10:06 speed8928