未验证 提交 0e74bbc0 编写于 作者: K Kaipeng Deng 提交者: GitHub

fix PIL may read image with rotation (#4565)

上级 3f2ce63d
...@@ -22,7 +22,7 @@ import copy ...@@ -22,7 +22,7 @@ import copy
import time import time
import numpy as np import numpy as np
from PIL import Image from PIL import Image, ImageOps
import paddle import paddle
import paddle.distributed as dist import paddle.distributed as dist
...@@ -527,6 +527,7 @@ class Trainer(object): ...@@ -527,6 +527,7 @@ class Trainer(object):
for i, im_id in enumerate(outs['im_id']): for i, im_id in enumerate(outs['im_id']):
image_path = imid2path[int(im_id)] image_path = imid2path[int(im_id)]
image = Image.open(image_path).convert('RGB') image = Image.open(image_path).convert('RGB')
image = ImageOps.exif_transpose(image)
self.status['original_image'] = np.array(image.copy()) self.status['original_image'] = np.array(image.copy())
end = start + bbox_num[i] end = start + bbox_num[i]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册