From e035261710a8e3cb335144e6c98c7defba2e986c Mon Sep 17 00:00:00 2001 From: Feng Ni Date: Sun, 26 Dec 2021 23:59:15 +0800 Subject: [PATCH] fix truncated image reading (#4936) --- deploy/pptracking/python/visualize.py | 3 ++- deploy/python/visualize.py | 3 ++- ppdet/engine/trainer.py | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/deploy/pptracking/python/visualize.py b/deploy/pptracking/python/visualize.py index 58de0a966..86dc0e9ad 100644 --- a/deploy/pptracking/python/visualize.py +++ b/deploy/pptracking/python/visualize.py @@ -17,7 +17,8 @@ from __future__ import division import os import cv2 import numpy as np -from PIL import Image, ImageDraw +from PIL import Image, ImageDraw, ImageFile +ImageFile.LOAD_TRUNCATED_IMAGES = True from collections import deque diff --git a/deploy/python/visualize.py b/deploy/python/visualize.py index c49068930..7e322973d 100644 --- a/deploy/python/visualize.py +++ b/deploy/python/visualize.py @@ -18,7 +18,8 @@ from __future__ import division import os import cv2 import numpy as np -from PIL import Image, ImageDraw +from PIL import Image, ImageDraw, ImageFile +ImageFile.LOAD_TRUNCATED_IMAGES = True import math diff --git a/ppdet/engine/trainer.py b/ppdet/engine/trainer.py index 157be4e31..0d073d028 100644 --- a/ppdet/engine/trainer.py +++ b/ppdet/engine/trainer.py @@ -23,7 +23,8 @@ import time import numpy as np import typing -from PIL import Image, ImageOps +from PIL import Image, ImageOps, ImageFile +ImageFile.LOAD_TRUNCATED_IMAGES = True import paddle import paddle.distributed as dist -- GitLab