Results 336 comments of Roman Solovyev
trafficstars

Also I must note I almost not tested masks functionality with this package.

I usually do it like that: ``` import cv2 i3 = prediction[0, :, :, 0] # Shape is (224, 224) here i3 = (i3*255).astype(np.uint8) # scale to 0-255 range and...

What backend did you use? For Tensorflow mask must be (16,224,224,1)

Check if you have the same input during training and during inference. I mean same normzlization, channel order or other preprocessing. It's the common mistake

Print mask.min(), mask.max() in your version please and why you do this mask = mask.reshape(INPUT_SIZE)?

dice_coef should work fine on multiple planes as well. You can't use "categorical_crossentropy" loss on such tasks, but you can use "binary_crossentropy".

1) I don't think current pretrained weights is ok to get features from layers. It's because generator of images for training was pretty simple. These weights must be used mostly...

As I remember: different number of convolutions and filters in each block. Also SpatialDropout before final layer. But overall it's very close to original UNET.

If you use pretrained weights then you need to convert grayscale image to RGB. For example with this code: `colored = cv2.cvtColor(gray, cv2.COLOR_GRAY2RGB)`

1) To load weiths use `model.load_weights(your_path)` before fit() 2) You can remove callbacks if you don't use them.