fuy34 / superpixel_fcn

[CVPR‘20] SpixelFCN: Superpixel Segmentation with Fully Convolutional Network
Other
392 stars 80 forks source link

Modification of superpixel size #47

Open Kitsmi opened 10 months ago

Kitsmi commented 10 months ago

Hello author, I have two questions to ask. Firstly, if I still use the BSDS500 dataset, I can set the superpixel size to 20 × 20 or 21 × 21 or any other value? Secondly, how can I modify the code to achieve this? Directly modifying the downsize as shown in the figure may result in an error. I made some changes to the code myself, but the result was not ideal. I think I overlooked some important parameters. Thank you. image

fuy34 commented 10 months ago

Thanks for your interest in our work. Not sure the exactly reason based on your description. But here are a few things you may want to check

  1. whether the image size is dividable by 20 or 21 in both height and width dimension
  2. whether the downsized image can be dividable by 16

if the answer to any of them is negative, please consider using a similar resizing strategy we implemented here.

Kitsmi commented 10 months ago

Thank you for your reply. I have ensured that the size of the input image is a multiple of 20 as you said. Although the model training can proceed normally, the results are not ideal. image

The generated superpixel image will produce many regular grid shapes. 5096_img_sPixel

And I am not sure if any other code should be changed. For example, the code in the 'train_util' or 'loss', I didn't explain it clearly before. I tried to modify the code in the 'train_util' and 'loss' before and it was able to train normally, but the results were not ideal. Like this image

And the results: 5096_img_sPixel 14092_img_sPixel

Another point is that when I did the first step of 'Data preparation', the generated images were mostly black. I'm not sure if this is normal or what version is problematic. image 8143_2_label

fuy34 commented 10 months ago

It sounds you re-trained the model. And there is some training issue. You may want to debug your training code.

The label are close to black because it is started with 1, 2, 3 etc. You can check the value if they looks normal to you.

DevKPro commented 9 months ago

Hello Kitsmi, have you resolved the issue? I encountered a similar problem as yours.