juhongm999 / hsnet

Official PyTorch Implementation of Hypercorrelation Squeeze for Few-Shot Segmentation, ICCV 2021
231 stars 43 forks source link

Evaluating on all classes at once #15

Closed joshmyersdean closed 2 years ago

joshmyersdean commented 2 years ago

Hello!

Fantastic work. I was wondering how/if someone could modify your code in order to perform inference as one would in typical semantic segmentation (evaluate on classes at once on a single image)? Is this possible in your framework?

Thank you for your time and for releasing code!

juhongm999 commented 2 years ago

To perform all-class inference, I would recommend you to save the features of the object class of your interest in some external memory, and use those features when building correlation tensors. For example, if you want to segment 5 object classes in some input image, then save (multi-level) features of each class by passing 5 images and corresponding class masks to the model. Given some input image you want to segment, the model provides (multi-level) features of that image. Using those features and the ones in the memory, you can obtain 5 mask predictions with 5 correlation tensors.

joshmyersdean commented 2 years ago

Thank you for the response!