diff --git a/ppstructure/predict_system.py b/ppstructure/predict_system.py index 71147d3af8ec666d368234270dcb0d16aaf91938..b9d6a7a8d691ff8835b08df3a3fe221ca4335989 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':