EfficientUnet

Keras Implementation of Unet with EfficientNet as encoder


Installation

Install efficientunet:

pip install efficientunet

Useful notes

  1. This library assumes channels_last !

  2. You cannot specify None for input_shape, since the input_shape is heavily used in the code for inferring the architecture. (The EfficientUnets are constructed dynamically)

  3. Since you cannot use None for input_shape, the image size for training process and for inference process have to be the same.
    If you do need to use a different image size for inference, a feasible solution is:

    1. Save the weights of your well-trained model
    2. Create a new model with the desired input shape
    3. Load the weights of your well-trained model into this newly created model
  4. Due to some rounding problem in the decoder path (not a bug, this is a feature :smirk:), the input shape should be divisible by 32.
    e.g. 224x224 is a suitable size for input images, but 225x225 is not.


Potential issues


Acknowledgment

  1. Some code snippets of EfficientNet are directly borrowed from this repo.
  2. The links of pretrained weights are borrowed from this repo.