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

How to do color rgb segmentation with your trainGenerator ? #47

Closed
arthurPrvst opened this issue Jun 15, 2018 · 3 comments
Closed

How to do color rgb segmentation with your trainGenerator ? #47

arthurPrvst opened this issue Jun 15, 2018 · 3 comments

Comments

@arthurPrvst
Copy link

Hi, I'm trying to do a color segmentation (I have grayscale image, and their labeled image with colors).

I changed mask_color_mode to "rgb", and num_class to 3 (because I have 3 differents colors) in data.py, and I changed input_size from 256,256,1 to 256,256,3 in model.py, but I still have errors..

"expected input_1 to have shape (None,256,256,3) but got array with shape (2,256,256,1).
I rune the debugger and, mask.shape gave me : (2,256,256,3) and omg.shape gave me : (2,256,256,1)

Any idea ? Thanks in advance :)

@ajithvcoder
Copy link

@arthurPrvst did u solve the issue ?

@lillux
Copy link

lillux commented Jun 19, 2018 via email

@arthurPrvst
Copy link
Author

I finally decided to go back to grasycale to reduce calculation in my network (I converted RGB to grayscale with nearest interpolation : the depth of the image was not useful).
But, you can bypass this problem by adding this modifications :

  • Set input layer to 512,512,1
  • Modify last conv9 : conv9 = Conv2D(64, 3, activation = 'relu', padding = 'same', kernel_initializer = 'he_normal')(conv9).
  • Modify conv10 : conv10 = Conv2D(1, 1, activation = 'sigmoid')(conv9) I have 3 classes here.

This modification are used of the code of this depot before his last commit (the add of generator for huge dataset). I would advise you to do the same and to do your own generator. Here is a good tutorial : https://stanford.edu/~shervine/blog/keras-how-to-generate-data-on-the-fly.html

Enjoy

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

3 participants