sgrvinod / a-PyTorch-Tutorial-to-Object-Detection

SSD: Single Shot MultiBox Detector | a PyTorch Tutorial to Object Detection
MIT License
3.04k stars 718 forks source link

cannot open resource on detect.py #70

Open rttariverdi67 opened 3 years ago

rttariverdi67 commented 3 years ago

hi! Thank you for this SSD code, quite touching :1st_place_medal: I face with strange error running detect.py, can anyone help me to solve it !? thank you.

Traceback (most recent call last): File "detect.py", line 102, in detect(original_image, min_score=0.2, max_overlap=0.5, top_k=200).show() File "detect.py", line 67, in detect font = ImageFont.truetype("./calibril.ttf", 15) File "/home/rahim/anaconda3/lib/python3.7/site-packages/PIL/ImageFont.py", line 642, in truetype return freetype(font) File "/home/rahim/anaconda3/lib/python3.7/site-packages/PIL/ImageFont.py", line 639, in freetype return FreeTypeFont(font, size, index, encoding, layout_engine) File "/home/rahim/anaconda3/lib/python3.7/site-packages/PIL/ImageFont.py", line 188, in init font, size, index, encoding, layout_engine=layout_engine OSError: cannot open resource

manojyasaswi commented 3 years ago

Hello, Search for the default fonts directory and choose one from the available options. Try without using ./ For me the following code snippet worked:

font = ImageFont.truetype("OpenSans-Regular.ttf", 20)