          out = self.upscale(512)(x)
          return KerasModel(retina, out)
      
  
      def Decoder(self):
          inp = Input(shape=(8, 8, 512))
          x = self.upscale(384)(inp)
          x = self.res_block(384)(x)
          x = self.upscale_sep(192)(x)
          x = self.res_block(192)(x)
          x = self.upscale(128)(x)
          x = self.res_block(128)(x)
          x = self.upscale(64)(x)
          x = self.res_block(64)(x)                    
          
  #         rb = Conv2D(64, kernel_size=3, padding="same", dilation_rate=2)(x)
  #         rb = LeakyReLU(alpha=0.2)(rb)
  #         rb = Conv2D(64, kernel_size=3, padding="same", dilation_rate=2)(rb)
  #         x = add([rb, x])
  # 
          #x = self.upscale(32)(x)        
                          
          out = Conv2D(3, kernel_size=5, padding='same', activation='sigmoid')(x)
                  
          return KerasModel(inp, out)
          
      
      def save_weights(self):
          from threading import Thread
          from time import sleep
 
</s> remove   
    
    def res_block(self, filters, dilation_rate=1):
        def block(x):
            rb = Conv2D(filters, kernel_size=3, padding="same", dilation_rate=dilation_rate, use_bias=False)(x)
            rb = LeakyReLU(alpha=0.2)(rb)
            rb = Conv2D(filters, kernel_size=3, padding="same", dilation_rate=dilation_rate, use_bias=False)(rb)
            x = add([rb, x])
            x = LeakyReLU(alpha=0.2)(x)
            return x
        return block       
    
 </s> add  </s> remove         return block      
    
    def res(self, filters, dilation_rate=1):
        def block(x):
            rb = Conv2D(filters, kernel_size=3, padding="same", dilation_rate=dilation_rate, use_bias=False)(x)
            rb = LeakyReLU(alpha=0.2)(rb)
            rb = Conv2D(filters, kernel_size=3, padding="same", dilation_rate=dilation_rate, use_bias=False)(rb)
            x = add([rb, x])
            x = LeakyReLU(alpha=0.2)(x)
            return x
 </s> add  </s> remove         x = Dense(4 * 4 * 1024)(x)
        x = Reshape((4, 4, 1024))(x)
        out = self.upscale(512)(x)
        return KerasModel(retina, out)
    
 </s> add         x = Dense(dense_shape * dense_shape * 768)(x)
        x = Reshape((dense_shape, dense_shape, 768))(x)
        x = self.upscale(512)(x)
        
        return KerasModel(impt, x, **kwargs)     </s> remove     def Encoder_v2(self):
        """Old algorithm; pretty good but slow"""
        retina = Input(shape=self.IMAGE_SHAPE)
        x = self.conv(128)(retina)         
        x = self.conv(144)(x)              
        x = self.conv_sep(256)(x)
        x = self.conv(448)(x)        
        x = self.conv_sep(512)(x)        
        x = self.conv(768)(x)
        x = self.conv_sep(1024)(x)
 </s> add     def Encoder_shaoanlu(self, **kwargs):
        impt = Input(shape=self.IMAGE_SHAPE)
                
        in_conv_filters = self.IMAGE_SHAPE[0] if self.IMAGE_SHAPE[0] <= 128 else 128 + (self.IMAGE_SHAPE[0]-128)//4
        
        x = Conv2D(in_conv_filters, kernel_size=5, kernel_initializer=conv_init, use_bias=False, padding="same")(impt)
        x = self.conv_sep3(in_conv_filters+32, use_instance_norm=False)(x)
        x = self.conv_sep3(256)(x)        
        x = self.conv_sep3(512)(x)
        x = self.conv_sep3(1024)(x)        
        
        dense_shape = self.IMAGE_SHAPE[0] // 16         
    def Decoder_original(self):       
        decoder_shape = self.IMAGE_SHAPE[0]//8        
        inpt = Input(shape=(decoder_shape, decoder_shape, 512))
        
        x = self.upscale(512, kernel_initializer=RandomNormal(0, 0.02))(inpt)
        x = self.upscale(256, kernel_initializer=RandomNormal(0, 0.02))(x)
        x = self.upscale(self.IMAGE_SHAPE[0], kernel_initializer=RandomNormal(0, 0.02))(x)
          out = self.upscale(512)(x)
          return KerasModel(retina, out)
      
  
    def Decoder_original(self):       
        decoder_shape = self.IMAGE_SHAPE[0]//8        
        inpt = Input(shape=(decoder_shape, decoder_shape, 512))
        
        x = self.upscale(512, kernel_initializer=RandomNormal(0, 0.02))(inpt)
        x = self.upscale(256, kernel_initializer=RandomNormal(0, 0.02))(x)
        x = self.upscale(self.IMAGE_SHAPE[0], kernel_initializer=RandomNormal(0, 0.02))(x)
    def Decoder_original(self):       
        decoder_shape = self.IMAGE_SHAPE[0]//8        
        inpt = Input(shape=(decoder_shape, decoder_shape, 512))
        
        x = self.upscale(512, kernel_initializer=RandomNormal(0, 0.02))(inpt)
        x = self.upscale(256, kernel_initializer=RandomNormal(0, 0.02))(x)
        x = self.upscale(self.IMAGE_SHAPE[0], kernel_initializer=RandomNormal(0, 0.02))(x)
    def Decoder_original(self):       
        decoder_shape = self.IMAGE_SHAPE[0]//8        
        inpt = Input(shape=(decoder_shape, decoder_shape, 512))
        
        x = self.upscale(512, kernel_initializer=RandomNormal(0, 0.02))(inpt)
        x = self.upscale(256, kernel_initializer=RandomNormal(0, 0.02))(x)
        x = self.upscale(self.IMAGE_SHAPE[0], kernel_initializer=RandomNormal(0, 0.02))(x)
    def Decoder_original(self):       
        decoder_shape = self.IMAGE_SHAPE[0]//8        
        inpt = Input(shape=(decoder_shape, decoder_shape, 512))
        
        x = self.upscale(512, kernel_initializer=RandomNormal(0, 0.02))(inpt)
        x = self.upscale(256, kernel_initializer=RandomNormal(0, 0.02))(x)
        x = self.upscale(self.IMAGE_SHAPE[0], kernel_initializer=RandomNormal(0, 0.02))(x)
    def Decoder_original(self):       
        decoder_shape = self.IMAGE_SHAPE[0]//8        
        inpt = Input(shape=(decoder_shape, decoder_shape, 512))
        
        x = self.upscale(512, kernel_initializer=RandomNormal(0, 0.02))(inpt)
        x = self.upscale(256, kernel_initializer=RandomNormal(0, 0.02))(x)
        x = self.upscale(self.IMAGE_SHAPE[0], kernel_initializer=RandomNormal(0, 0.02))(x)
    def Decoder_original(self):       
        decoder_shape = self.IMAGE_SHAPE[0]//8        
        inpt = Input(shape=(decoder_shape, decoder_shape, 512))
        
        x = self.upscale(512, kernel_initializer=RandomNormal(0, 0.02))(inpt)
        x = self.upscale(256, kernel_initializer=RandomNormal(0, 0.02))(x)
        x = self.upscale(self.IMAGE_SHAPE[0], kernel_initializer=RandomNormal(0, 0.02))(x)
    def Decoder_original(self):       
        decoder_shape = self.IMAGE_SHAPE[0]//8        
        inpt = Input(shape=(decoder_shape, decoder_shape, 512))
        
        x = self.upscale(512, kernel_initializer=RandomNormal(0, 0.02))(inpt)
        x = self.upscale(256, kernel_initializer=RandomNormal(0, 0.02))(x)
        x = self.upscale(self.IMAGE_SHAPE[0], kernel_initializer=RandomNormal(0, 0.02))(x)
    def Decoder_original(self):       
        decoder_shape = self.IMAGE_SHAPE[0]//8        
        inpt = Input(shape=(decoder_shape, decoder_shape, 512))
        
        x = self.upscale(512, kernel_initializer=RandomNormal(0, 0.02))(inpt)
        x = self.upscale(256, kernel_initializer=RandomNormal(0, 0.02))(x)
        x = self.upscale(self.IMAGE_SHAPE[0], kernel_initializer=RandomNormal(0, 0.02))(x)
    def Decoder_original(self):       
        decoder_shape = self.IMAGE_SHAPE[0]//8        
        inpt = Input(shape=(decoder_shape, decoder_shape, 512))
        
        x = self.upscale(512, kernel_initializer=RandomNormal(0, 0.02))(inpt)
        x = self.upscale(256, kernel_initializer=RandomNormal(0, 0.02))(x)
        x = self.upscale(self.IMAGE_SHAPE[0], kernel_initializer=RandomNormal(0, 0.02))(x)
    def Decoder_original(self):       
        decoder_shape = self.IMAGE_SHAPE[0]//8        
        inpt = Input(shape=(decoder_shape, decoder_shape, 512))
        
        x = self.upscale(512, kernel_initializer=RandomNormal(0, 0.02))(inpt)
        x = self.upscale(256, kernel_initializer=RandomNormal(0, 0.02))(x)
        x = self.upscale(self.IMAGE_SHAPE[0], kernel_initializer=RandomNormal(0, 0.02))(x)
    def Decoder_original(self):       
        decoder_shape = self.IMAGE_SHAPE[0]//8        
        inpt = Input(shape=(decoder_shape, decoder_shape, 512))
        
        x = self.upscale(512, kernel_initializer=RandomNormal(0, 0.02))(inpt)
        x = self.upscale(256, kernel_initializer=RandomNormal(0, 0.02))(x)
        x = self.upscale(self.IMAGE_SHAPE[0], kernel_initializer=RandomNormal(0, 0.02))(x)
    def Decoder_original(self):       
        decoder_shape = self.IMAGE_SHAPE[0]//8        
        inpt = Input(shape=(decoder_shape, decoder_shape, 512))
        
        x = self.upscale(512, kernel_initializer=RandomNormal(0, 0.02))(inpt)
        x = self.upscale(256, kernel_initializer=RandomNormal(0, 0.02))(x)
        x = self.upscale(self.IMAGE_SHAPE[0], kernel_initializer=RandomNormal(0, 0.02))(x)
    def Decoder_original(self):       
        decoder_shape = self.IMAGE_SHAPE[0]//8        
        inpt = Input(shape=(decoder_shape, decoder_shape, 512))
        
        x = self.upscale(512, kernel_initializer=RandomNormal(0, 0.02))(inpt)
        x = self.upscale(256, kernel_initializer=RandomNormal(0, 0.02))(x)
        x = self.upscale(self.IMAGE_SHAPE[0], kernel_initializer=RandomNormal(0, 0.02))(x)
    def Decoder_original(self):       
        decoder_shape = self.IMAGE_SHAPE[0]//8        
        inpt = Input(shape=(decoder_shape, decoder_shape, 512))
        
        x = self.upscale(512, kernel_initializer=RandomNormal(0, 0.02))(inpt)
        x = self.upscale(256, kernel_initializer=RandomNormal(0, 0.02))(x)
        x = self.upscale(self.IMAGE_SHAPE[0], kernel_initializer=RandomNormal(0, 0.02))(x)
    def Decoder_original(self):       
        decoder_shape = self.IMAGE_SHAPE[0]//8        
        inpt = Input(shape=(decoder_shape, decoder_shape, 512))
        
        x = self.upscale(512, kernel_initializer=RandomNormal(0, 0.02))(inpt)
        x = self.upscale(256, kernel_initializer=RandomNormal(0, 0.02))(x)
        x = self.upscale(self.IMAGE_SHAPE[0], kernel_initializer=RandomNormal(0, 0.02))(x)
    def Decoder_original(self):       
        decoder_shape = self.IMAGE_SHAPE[0]//8        
        inpt = Input(shape=(decoder_shape, decoder_shape, 512))
        
        x = self.upscale(512, kernel_initializer=RandomNormal(0, 0.02))(inpt)
        x = self.upscale(256, kernel_initializer=RandomNormal(0, 0.02))(x)
        x = self.upscale(self.IMAGE_SHAPE[0], kernel_initializer=RandomNormal(0, 0.02))(x)
    def Decoder_original(self):       
        decoder_shape = self.IMAGE_SHAPE[0]//8        
        inpt = Input(shape=(decoder_shape, decoder_shape, 512))
        
        x = self.upscale(512, kernel_initializer=RandomNormal(0, 0.02))(inpt)
        x = self.upscale(256, kernel_initializer=RandomNormal(0, 0.02))(x)
        x = self.upscale(self.IMAGE_SHAPE[0], kernel_initializer=RandomNormal(0, 0.02))(x)
    def Decoder_original(self):       
        decoder_shape = self.IMAGE_SHAPE[0]//8        
        inpt = Input(shape=(decoder_shape, decoder_shape, 512))
        
        x = self.upscale(512, kernel_initializer=RandomNormal(0, 0.02))(inpt)
        x = self.upscale(256, kernel_initializer=RandomNormal(0, 0.02))(x)
        x = self.upscale(self.IMAGE_SHAPE[0], kernel_initializer=RandomNormal(0, 0.02))(x)
    def Decoder_original(self):       
        decoder_shape = self.IMAGE_SHAPE[0]//8        
        inpt = Input(shape=(decoder_shape, decoder_shape, 512))
        
        x = self.upscale(512, kernel_initializer=RandomNormal(0, 0.02))(inpt)
        x = self.upscale(256, kernel_initializer=RandomNormal(0, 0.02))(x)
        x = self.upscale(self.IMAGE_SHAPE[0], kernel_initializer=RandomNormal(0, 0.02))(x)
    def Decoder_original(self):       
        decoder_shape = self.IMAGE_SHAPE[0]//8        
        inpt = Input(shape=(decoder_shape, decoder_shape, 512))
        
        x = self.upscale(512, kernel_initializer=RandomNormal(0, 0.02))(inpt)
        x = self.upscale(256, kernel_initializer=RandomNormal(0, 0.02))(x)
        x = self.upscale(self.IMAGE_SHAPE[0], kernel_initializer=RandomNormal(0, 0.02))(x)
    def Decoder_original(self):       
        decoder_shape = self.IMAGE_SHAPE[0]//8        
        inpt = Input(shape=(decoder_shape, decoder_shape, 512))
        
        x = self.upscale(512, kernel_initializer=RandomNormal(0, 0.02))(inpt)
        x = self.upscale(256, kernel_initializer=RandomNormal(0, 0.02))(x)
        x = self.upscale(self.IMAGE_SHAPE[0], kernel_initializer=RandomNormal(0, 0.02))(x)
          
      
      def save_weights(self):
          from threading import Thread
          from time import sleep
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 model update (#417)

New, functional Original 128 model 
plugins/Model_OriginalHighRes/Model.py