changed layer
Browse files
app.py
CHANGED
@@ -7,9 +7,9 @@ from tensorflow.keras.models import Model
|
|
7 |
from tensorflow.keras.applications.mobilenet_v2 import MobileNetV2, preprocess_input
|
8 |
from tensorflow.keras.preprocessing.sequence import pad_sequences
|
9 |
|
10 |
-
# Load MobileNetV2 model for feature extraction (
|
11 |
-
mobilenet_model = MobileNetV2(weights="imagenet")
|
12 |
-
mobilenet_model = Model(inputs=mobilenet_model.inputs, outputs=mobilenet_model.
|
13 |
|
14 |
|
15 |
# Load the trained captioning model
|
|
|
7 |
from tensorflow.keras.applications.mobilenet_v2 import MobileNetV2, preprocess_input
|
8 |
from tensorflow.keras.preprocessing.sequence import pad_sequences
|
9 |
|
10 |
+
# Load MobileNetV2 model for feature extraction (with pooling and no top layer)
|
11 |
+
mobilenet_model = MobileNetV2(weights="imagenet", include_top=False, pooling='avg')
|
12 |
+
mobilenet_model = Model(inputs=mobilenet_model.inputs, outputs=mobilenet_model.output)
|
13 |
|
14 |
|
15 |
# Load the trained captioning model
|