Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
|
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 |
|