poppinace / indexnet_matting

(ICCV'19) Indices Matter: Learning to Index for Deep Image Matting
Other
389 stars 90 forks source link

RandomCrop 对于图像尺寸320的处理会抛出异常 #25

Closed QWERDF007 closed 4 years ago

QWERDF007 commented 4 years ago

对于图像尺寸为320的,会在hldataset.py 里的 Class RandomCrop crop_size[crop_size < min(h, w)]得到一个空的list,接着random.choice(crop_size)会抛出异常

poppinace commented 4 years ago

Maybe check whether you have loaded an image successfully.

QWERDF007 commented 4 years ago

读取成功了,不然在这之前的 image.shape 会报 None type no attribute shape,可能你的图像都是高分辨率的,当 crop_size 里的元素都大于或者等于 min(h,w) 返回的是False,所以索引得到的列表是空的,因此 random.choice 会抛出异常,改成 crop_size <= min(h,w) 解决