yolact icon indicating copy to clipboard operation
yolact copied to clipboard

Maks resize error

Open chang007game opened this issue 4 years ago • 3 comments

File "E:\yolact-master\utils\augmentations.py", line 160, in call masks = cv2.resize(masks, (width, height)) cv2.error: OpenCV(3.4.2) C:\projects\opencv-python\opencv\modules\imgproc\src\resize.cpp:3687: error: (-215:Assertion failed) !dsize.empty() in function 'cv::hal::resize' how can i do reslove this problem

chang007game avatar Sep 04 '20 03:09 chang007game

I have the same problem. Could you have solved it? Thanks

wwq98 avatar Oct 05 '20 09:10 wwq98

I have the same problem. Could you have solved it? Thanks

Could you have solved it?

jieruyao49 avatar Jun 01 '21 06:06 jieruyao49

if number of objects at the image is more than 512 open cv resize method crushes. To solve this problem modify the line masks = cv2.resize(masks, (width, height)) at /yolact-master/utils/augmentations.py, (~ line 162):

cv_limit = 512
if masks.shape[2] <= cv_limit:
    masks = cv2.resize(masks, (width, height))
else:
    # split masks array on batches with max size 512 along channel axis, resize and merge them back
    masks = np.concatenate([cv2.resize(masks[:, :, i:min(i + cv_limit, masks.shape[2])], (width, height))
                            for i in range(0, masks.shape[2], cv_limit)], axis=2)

VABer-dv avatar Apr 26 '22 11:04 VABer-dv