未验证 提交 7826f247 编写于 作者: K Kaipeng Deng 提交者: GitHub

fix PIL may read image with rotation (#4563)

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