From de36384a66b9e51e4f9cb208ac2f997e73152fcf Mon Sep 17 00:00:00 2001 From: WenmuZhou <572459439@qq.com> Date: Thu, 22 Sep 2022 09:32:19 +0800 Subject: [PATCH] fix angle 0 image rotate error --- ppstructure/predict_system.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ppstructure/predict_system.py b/ppstructure/predict_system.py index 71147d3a..b9d6a7a8 100644 --- a/ppstructure/predict_system.py +++ b/ppstructure/predict_system.py @@ -100,7 +100,8 @@ class StructureSystem(object): '180': cv2.ROTATE_180, '270': cv2.ROTATE_90_CLOCKWISE } - img = cv2.rotate(img, cv_rotate_code[angle]) + if angle in cv_rotate_code: + img = cv2.rotate(img, cv_rotate_code[angle]) toc = time.time() time_dict['image_orientation'] = toc - tic if self.mode == 'structure': -- GitLab