Spaces:
Sleeping
Sleeping
Commit
·
fba3e16
1
Parent(s):
6b5bfa1
Update app.py
Browse files
app.py
CHANGED
@@ -48,7 +48,13 @@ def load_decoder_model():
|
|
48 |
# return encoder
|
49 |
|
50 |
|
51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
FEATURE_EXTRACTOR.trainable = False
|
53 |
image_input = Input(shape=(IMG_HEIGHT, IMG_WIDTH, IMG_CHANNELS))
|
54 |
image_features = FEATURE_EXTRACTOR(image_input)
|
|
|
48 |
# return encoder
|
49 |
|
50 |
|
51 |
+
@st.cache_resource()
|
52 |
+
def feature_extractor():
|
53 |
+
FEATURE_EXTRACTOR=tf.keras.models.load_model('./feature_extractor.h5')
|
54 |
+
return FEATURE_EXTRACTOR
|
55 |
+
|
56 |
+
|
57 |
+
FEATURE_EXTRACTOR = feature_extractor()
|
58 |
FEATURE_EXTRACTOR.trainable = False
|
59 |
image_input = Input(shape=(IMG_HEIGHT, IMG_WIDTH, IMG_CHANNELS))
|
60 |
image_features = FEATURE_EXTRACTOR(image_input)
|