eybro commited on
Commit
381fd53
·
verified ·
1 Parent(s): a79b893

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -40,9 +40,13 @@ def process_image(image):
40
  img = img.astype('float32')
41
  img /= 255.0
42
  img = np.expand_dims(img, axis=0)
43
- encoded_features = autoencoder.predict(img)
44
 
45
- return encoded_features
 
 
 
 
 
46
 
47
  def inference(image):
48
 
 
40
  img = img.astype('float32')
41
  img /= 255.0
42
  img = np.expand_dims(img, axis=0)
 
43
 
44
+ layer_model = Model(inputs=model.input, outputs=model.layers[layer].output)
45
+
46
+ encoded_array = layer_model.predict(img)
47
+
48
+ pooled_array = encoded_array.max(axis=-1)
49
+ return pooled_array # Shape: (1, n_features)
50
 
51
  def inference(image):
52