Hello Harsh,
First of all, I want to say thank you very much for sharing your work about this background removal! One of my current projects is quite related to it. I have read both your articles and your code repo and they are quite helpful to me! Thanks a lot! :)
I am using Detectron2 to do instance segmentation (human face + hair) on images and achieved 91% precision. My next step is to do background removal on those segmentations. I understand from your article that a trimap is needed, and you mentioned, " However, with a few tweaks, we can get the probability values from the Detectron model also.", I am wondering whether you can share those codes as well? I tried to track down the raw code of detectron2 and found it hard to get it out. Thanks a lot!!
I did look at your detectron_seg.py script, but I see the outputs (using out.pred_mask as below code shows) look like still just binary instead of pixel-level probability for the segmentation.
` def get_seg_output(self,image:np.array):
out = self.model(image)['instances']
outputs = [(out.pred_masks[i],out.pred_classes[i]) for i in range(len(out.pred_classes)) if out.pred_classes[i]==0]
return outputs`
Hello Harsh,
First of all, I want to say thank you very much for sharing your work about this background removal! One of my current projects is quite related to it. I have read both your articles and your code repo and they are quite helpful to me! Thanks a lot! :)
I am using Detectron2 to do instance segmentation (human face + hair) on images and achieved 91% precision. My next step is to do background removal on those segmentations. I understand from your article that a trimap is needed, and you mentioned, " However, with a few tweaks, we can get the probability values from the Detectron model also.", I am wondering whether you can share those codes as well? I tried to track down the raw code of detectron2 and found it hard to get it out. Thanks a lot!!
I did look at your detectron_seg.py script, but I see the outputs (using out.pred_mask as below code shows) look like still just binary instead of pixel-level probability for the segmentation.
` def get_seg_output(self,image:np.array):
out = self.model(image)['instances']