현재 데이터증강 작업을 수행하기위해 이미지크기 조절 수행및 이미지 좌우 반전수행을 진행중입니다 사용모듈은 import albumentations as A 사용중입니다
이때 이미지크기 조절은 transform = A.Compose([
A.Resize(height=800, width=800),
A.Normalize(mean=(0.485, 0.456, 0.406), std=(0.229, 0.224, 0.225)),
ToTensorV2()
], bbox_params=A.BboxParams(format='coco', label_fields=['labels']), is_check_shapes=False) 으로 800 800 으로 바꾼후 정규화 과정을 수행하여 정상실행되고 결과사진도 문제없이 작동합니다
이제 이미지좌우반전을 수행하기위해서
transform_rotation = A.Compose([
A.HorizontalFlip(p=1),
A.Normalize(mean=(0.485, 0.456, 0.406), std=(0.229, 0.224, 0.225)),
ToTensorV2()
], bbox_params=A.BboxParams(format='coco', label_fields=['labels']), is_check_shapes=False)
똑같이 A.HorizontalFlip을 수행하였는데 OpenCV(4.8.0) D:\a\opencv-python\opencv-python\opencv\modules\core\src\matrix_transform.cpp:780: error: (-215:Assertion failed) _src.dims() <= 2 in function 'cv::flip 이러한 에러가 발생합니다 이미지 차원이 안맞는것같은데
DataLoader에서는 if self.transforms is not None:
image = np.array(image)
transformed = self.transforms(image=image, bboxes=target['bbox'], mask=target['masks'],
labels=target['labels'], area=target['area'], iscrowd=target['iscrowd']) 명시적으로 전부 인자를 주었는데 에러가 발생합니다 원인이 무엇일까요 ...??