提交 d7e6898c 编写于 作者: N Napat Rc 提交者: Adam Geitgey

fixed PIL error "OSError: image file is truncated"

Some image file is truancated may cause PIL load image error
See: https://stackoverflow.com/a/23575424
上级 27cdb223
......@@ -3,6 +3,7 @@
import PIL.Image
import dlib
import numpy as np
from PIL import ImageFile
try:
import face_recognition_models
......@@ -11,6 +12,8 @@ except Exception:
print("pip install git+https://github.com/ageitgey/face_recognition_models")
quit()
ImageFile.LOAD_TRUNCATED_IMAGES = True
face_detector = dlib.get_frontal_face_detector()
predictor_68_point_model = face_recognition_models.pose_predictor_model_location()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册