sbelharbi / wsol-min-max-entropy-interpretability

Pytorch code for: Min-max Entropy for Weakly Supervised Pointwise Localization
GNU General Public License v3.0
16 stars 5 forks source link

training on my dataset #1

Open marshellhu opened 5 years ago

marshellhu commented 5 years ago

hello the authors. I have tried your paper and code. Firstly, it works. But there are some problems. the result of true mask comes to like this. image secondly, how can I use my own dataset? how to use the create_flods.py? finally, it is really a interesting work.

sbelharbi commented 5 years ago

hello, sorry for late reply. for some unknown reason, i did not receive a notification when this issue has been opened. i contacted the github team.

  1. mask issue: did you make any changes to the code?

i think this is the sample 00001.jpg. from my previous figures, the mask seems to be ok. [the second on the left] image_00001

this is the original mask, original-segmim_00001

and this is the binary mask that we create, segmim_00001

can you check that create_folds.py has correctly created the binary masks? https://github.com/sbelharbi/wsol-min-max-entropy-interpretability/blob/cf0bfd586451974f7408530d2223c0b1aabb4ffc/create_folds.py#L733

can you please check the true mask at this line? its dtype, min, max values. the function expects a numpy.ndarray of type float with values in [0, 1]. in this case, it is a binary mask with 0/1. it seems to me that it is not the case, and somehow, the values are greater than 1, because this function will multiply the mask by 255. https://github.com/sbelharbi/wsol-min-max-entropy-interpretability/blob/cf0bfd586451974f7408530d2223c0b1aabb4ffc/tools.py#L590

the image you are showing was obtained after the mask has been converted into a float binary, here https://github.com/sbelharbi/wsol-min-max-entropy-interpretability/blob/cf0bfd586451974f7408530d2223c0b1aabb4ffc/tools.py#L1224

then, calling the visualizer, https://github.com/sbelharbi/wsol-min-max-entropy-interpretability/blob/cf0bfd586451974f7408530d2223c0b1aabb4ffc/tools.py#L1232

this is the function that draws the true mask, https://github.com/sbelharbi/wsol-min-max-entropy-interpretability/blob/cf0bfd586451974f7408530d2223c0b1aabb4ffc/tools.py#L240

you can check the value of the mask. let me know.

  1. create folds for your own dataset? i think i already answered you by email.

thanks