plemeri / InSPyReNet

Official PyTorch implementation of Revisiting Image Pyramid Structure for High Resolution Salient Object Detection (ACCV 2022)
MIT License
497 stars 73 forks source link

Multiple masks area #41

Closed crapthings closed 11 months ago

crapthings commented 11 months ago

can i split the cloth masking to tops and bottoms? or should training multiple models for such task?

plemeri commented 11 months ago

Hi @crapthings, you need to change our model into multi-class segmentation model while this model can be regarded as technically a binary segmentation, foreground and background. It is not a hard work, just change the output channel from 1 to the number of classes (in your case, 2), change the activation of the final output logit from sigmoid to softmax, and change the loss function. You might want cross entropy loss which supports multi class logit with softmax activation. Also, don't forget to modify dataloder to encode the annotation into one-hot or integer mask.

Or, you can just use other semantic segmentation models such as mmsegmentation. Good luck on your project!