webb-c / RAID

Reinforcement Assisted Image Defense against Adversarial Attacks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bug: Gaussian Blurring

webb-c opened this issue · comments

특정 조건일 때 다음 에러가 계속 발생

cv2.error: OpenCV(4.8.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\smooth.dispatch.cpp:617: error: (-215:Assertion failed) !_src.empty() in function 'cv::GaussianBlur'

kernel_size가 1일 때 kernel이 만들어지지 않아서 발생하는 것으로 확인.

더 일반적인 원인이었던 kernel_radius = int(self.size * std) + 1값이 0 범위로 내려가는 것을 막기 위해 1을 더하는 방식으로 임시조치를 취해둠