Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Segmentation #23

Open
digital-idiot opened this issue Feb 4, 2021 · 2 comments
Open

Support for Segmentation #23

digital-idiot opened this issue Feb 4, 2021 · 2 comments

Comments

@digital-idiot
Copy link

digital-idiot commented Feb 4, 2021

It seems that semantic segmentation is not supported, only image classification is supported. When I build a model with input_shape = [256, 256,3] and n_classes = 6, it creates a model with output shape [None,6]. The verbose output is:

stem_out (None, 128, 128, 64)
MaxPool2D out (None, 64, 64, 64)
----- layer 0 out (None, 64, 64, 256) -----
----- layer 1 out (None, 32, 32, 512) -----
----- layer 2 out (None, 16, 16, 1024) -----
----- layer 3 out (None, 8, 8, 2048) -----
pool_out: (None, 2048)
fc_out: (None, 6)
Resnest builded with input (None, 256, 256, 4), output(None, 6)
  • How can I modified it for semantic segmentation?
@qiaoran-dawnlight
Copy link

@digital-idiot Hi, sorry for the late reply, if you want a semantic segmentation, then the model output size should same as input size. Semantic segmentation has its own model design, because we usually need deconvolution/resize the features that been convolution from input, like textbook U-net, So the classification model cant directly used for Semantic segmentation. But can be directly used as backbone for object detection, instance segmentation, etc.

@qiaoran-dawnlight
Copy link

qiaoran-dawnlight commented Apr 20, 2021

For this case specific, if i want to change it to semantic segmentation, the simple way is modified like u-net. just deconvolution it. following is just a general ideal.

usual convolution way
----- layer 0 out (None, 64, 64, 256) -----
----- layer 1 out (None, 32, 32, 512) -----
----- layer 2 out (None, 16, 16, 1024) -----
----- layer 3 out (None, 8, 8, 2048) -----

start deconvolution (can try use similar bock style from convolution)
(layer 3 (None, 8, 8, 2048) -> (None, 16, 16, 1024)+ layer 2 out (None, 16, 16, 1024) -> (None, 16, 16, 2048) -> (None, 16, 16, 1024)
----- layer 4 out (None, 16, 16, 1024) -----
----- layer 5 out (None, 32, 32, 512) -----
----- layer 6 out (None, 64, 64, 256) -----
----- layer 7 out (None, 128, 128, 128) -----
----- layer 8 out (None, 256, 256, 64) -----
fc (None, 256, 256, 6) -----

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants