Yanfeng-Zhou / XNet

[ICCV2023] XNet: Wavelet-Based Low and High Frequency Merging Networks for Semi- and Supervised Semantic Segmentation of Biomedical Images
MIT License
184 stars 8 forks source link

小波变换会造成图片尺寸变小 #2

Closed DreamerrW closed 11 months ago

DreamerrW commented 11 months ago

使用了小波变换后,我发现我的图片变成了原来的一半,请问作者是怎么解决这个问题的?分割掩码也要下采样吗?

Yanfeng-Zhou commented 11 months ago

注意我的代码中的/config/augmentation/online_aug.py中,在训练你可以将输入图像resize到任意大小!小波变换的目的是为了得到L和H图像,它们的大小在训练中可以随意调整,当然也可以resize到raw image的尺寸。我的程序中,mask的尺寸会自动与输入图像尺寸保持一致!

Question: Wavelet transform will reduce the image size by half, how to deal with it?

Answer: Note that in /config/augmentation/online_aug.py in my code, you can resize the input image to any size during training! The purpose of wavelet transform is to obtain L and H images. Their size can be adjusted at will during training, and of course they can also be resized to the size of the raw image. In my code, the size of the mask will automatically be consistent with the size of the input image!

DreamerrW commented 11 months ago

好的,感谢!

Yanfeng-Zhou commented 11 months ago

正确顺序应该是这样的:(1)滑窗裁剪至256256(同时掩码也需要一摸一样的操作),(2)小波变换得到128128的L和H(掩码也可以resize一份128128的,但不强求,因为后面训练的时候online_aug.py会将mask和image的size调整到一致),(3)训练模型(训练尺寸根据online_aug.py里的参数来确定,我在论文中用的是128128) res_image_mask.py是给conresnet生成掩码用的,至于conresnet为什么需要这种掩码请看它的原论文