isht7 / pytorch-deeplab-resnet

DeepLab resnet v2 model in pytorch
MIT License
602 stars 118 forks source link

How do get car mask only? #33

Closed yfnn closed 6 years ago

yfnn commented 6 years ago

I used your code for car segmentation. I loaded the pretrained model. But there are 21 labels in VOC. I just want to get mask of cars while not display other labels on the result image. What should I do?

isht7 commented 6 years ago

If the label for car is x, you can get a binary mask with 1 for car and 0 for everything else by doing mask = output_pred==x