Skip to content

U-Net shape  #11

@zyazdani-92

Description

@zyazdani-92

Hello, I trained U-Net with one-class batches with the size of (128,128), and get prediction results of the size of (128,128). I would like to use Smoothly-Blend-Image-Patches function to remove border artifacts in the prediction results of my trained U-Net model. My input images are 8-bit grayscale with a size of (799,799). When I use your function I have the following error:

WARNING:tensorflow:Model` was constructed with shape (None, 128, 128, 1) for input KerasTensor(type_spec=TensorSpec(shape=(None, 128, 128, 1), dtype=tf.float32, name='input_1'), name='input_1', description="created by layer 'input_1'"), but it was called on an input with incompatible shape (None, 128, 128, 3).

I applied #4 and #3 but still I have error. Which function should be changed to make this pipeline compatible with my U-Net model?
Thank you so much.


Update: I reshape my input image as follows:
input_img = io.imread('RatNeuron_5_666_Bw_2_5X.tif')

input_img = input_img.reshape((799,799,1))
And then could run the Smoothly-Blend-Image-Patches function
But the prediction result is extremely changed.

  1. First image is my input image.
  2. Second image is the prediction result without using Smoothly-Blend-Image-Patches function.
  3. Third image is the prediction result with Smoothly-Blend-Image-Patches function.

input

U_Cell_RatNeuron_5_666_Bw_2_5X_min_0 2

U_Neurite+Cell_RatNeuron_5_666_Bw_2_5X

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions