From d9129c1ea3f706751802db36adc633bcda211e75 Mon Sep 17 00:00:00 2001 From: jiajie555 Date: Sun, 27 Apr 2025 16:41:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A7=86=E9=A2=91=E6=97=8B?= =?UTF-8?q?=E8=BD=AC=E8=A7=92=E5=BA=A6=E4=BF=A1=E6=81=AF=E7=94=B1opencv?= =?UTF-8?q?=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ultralytics/data/loaders.py | 15 ++++++++------- utils/dataloaders.py | 12 ++++++------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/ultralytics/data/loaders.py b/ultralytics/data/loaders.py index 8d9183b..fe508f2 100644 --- a/ultralytics/data/loaders.py +++ b/ultralytics/data/loaders.py @@ -342,13 +342,14 @@ class LoadImagesAndVideos: if success: success, im0 = self.cap.retrieve() - ##====================== - '''判断视频是否含旋转信息''' - rotation = self.get_rotation(path) - if rotation == 270: - im0 = cv2.rotate(im0, cv2.ROTATE_90_COUNTERCLOCKWISE) - ###====================== - + # ##====================== + # '''判断视频是否含旋转信息''' + # rotation = self.get_rotation(path) + # print('**********rotation', rotation) + # if rotation == 270: + # im0 = cv2.rotate(im0, cv2.ROTATE_90_COUNTERCLOCKWISE) + # ###====================== + print('&&&&&&&&&&&&&&&self.orientation', self.orientation) if self.orientation == 270: im0 = cv2.rotate(im0, cv2.ROTATE_90_COUNTERCLOCKWISE) # for use if cv2 autorotation is False diff --git a/utils/dataloaders.py b/utils/dataloaders.py index 13ad9a4..21c1dcf 100644 --- a/utils/dataloaders.py +++ b/utils/dataloaders.py @@ -303,12 +303,12 @@ class LoadImages: ret_val, im0 = self.cap.read() self.frame += 1 - ##====================== - '''判断视频是否含旋转信息''' - rotation = self.get_rotation(path) - if rotation == 270: - im0 = cv2.rotate(im0, cv2.ROTATE_90_COUNTERCLOCKWISE) - ###====================== + # ##====================== + # '''判断视频是否含旋转信息''' + # rotation = self.get_rotation(path) + # if rotation == 270: + # im0 = cv2.rotate(im0, cv2.ROTATE_90_COUNTERCLOCKWISE) + # ###====================== if self.orientation == 270: im0 = cv2.rotate(im0, cv2.ROTATE_90_COUNTERCLOCKWISE) # for use if cv2 autorotation is False