GeorgeSeif / Semantic-Segmentation-Suite

Semantic Segmentation Suite in TensorFlow. Implement, train, and test new Semantic Segmentation models easily!
2.51k stars 878 forks source link

Removing background and using larger image #177

Open shubhank008 opened 5 years ago

shubhank008 commented 5 years ago

I just found this repo after banging my head a few times in DeepLab and not getting any answers. I am still testing it but this seems to be a collection of multiple models/systems so I wanted to know and clarify my doubts I had when trying DeepLab's Xception.

Can we detect a person and remove the background (ultimately extracting the person only in a transparent png) ? If so, any pointers ? Can we use larger input images and get same size output images ? DeepLab and most of the models rescale input image to 512px and output same 512px/smaller images. I wanted to try doing this on 1k px or even larger images, and to get similar size/resolution output.

Again, sorry for asking noob questions, I am still trying this repo but a bit overwhelmed.

ryohachiuma commented 5 years ago

Hi,

1st answer: you can remove the background if you could segment the person correctly. You can get the binary segmentation map (person or background) and take the bit-wise and. (https://stackoverflow.com/questions/10469235/opencv-apply-mask-to-a-color-image/38493075)

2nd answer: yes. You can try on 1k px. However, maybe the GPU memory should be exhausted, it depends on what GPU you are using and the batch size.