lim-anggun / FgSegNet_v2

FgSegNet_v2: "Learning Multi-scale Features for Foreground Segmentation.” by Long Ang LIM and Hacer YALIM KELES
https://arxiv.org/abs/1808.01477
Other
149 stars 43 forks source link

how can I evaluate the segmentation results quantificationally? #9

Closed Rongrong-LIU525 closed 5 years ago

Rongrong-LIU525 commented 5 years ago

Hello, thank you again for sharing your work. You have provided a notebook to see the prediction example , and I want to know how you evaluate the results quantificationally. You extract the resulting segmentation picture from the ipynb, then calculate the F-measures and other metrics somewhere else? Thank you.

Rongrong-LIU525 commented 5 years ago

I want to extract the prediction result and measure it with my former matlab programmes. But when I download directly or save the segmentation result, the pixels are changed. I have tried but still can not save it with the original shape. Do you have any idea?

lim-anggun commented 5 years ago

Hi @MaggieGlory , You don't need to calculate the score using Matlab since scikit learn provides useful functions to compute the score. What you need to do is:

  1. Extract foreground mask (predicted values from sigmoid function are between 0 and 1.) e.g. probs

  2. Binarize the extracted mask in step 1, say:

    threshold = 0.8
    probs[probs<threshold] = 0.
    probs[probs>=threshold] = 1.
  3. Compute the F1-score using Scikit Learn

I will upload my code on how to compute F1-score later this week. Stay tuned!

Rongrong-LIU525 commented 5 years ago

Thanks so much for your reply. -