Update app.py
Browse files
app.py
CHANGED
@@ -9,6 +9,7 @@ from tensorflow.keras.applications.resnet50 import ResNet50, preprocess_input
|
|
9 |
from sklearn.neighbors import NearestNeighbors
|
10 |
from numpy.linalg import norm
|
11 |
from chatbot import Chatbot # Assuming you have a chatbot module
|
|
|
12 |
|
13 |
# Define function for feature extraction
|
14 |
def feature_extraction(img_path, model):
|
@@ -51,7 +52,7 @@ def show_dashboard():
|
|
51 |
# Load ResNet model for image feature extraction
|
52 |
model = ResNet50(weights='imagenet', include_top=False, input_shape=(224, 224, 3))
|
53 |
model.trainable = False
|
54 |
-
model =
|
55 |
model,
|
56 |
GlobalMaxPooling2D()
|
57 |
])
|
|
|
9 |
from sklearn.neighbors import NearestNeighbors
|
10 |
from numpy.linalg import norm
|
11 |
from chatbot import Chatbot # Assuming you have a chatbot module
|
12 |
+
import tensorflow as tf # Make sure this import is included
|
13 |
|
14 |
# Define function for feature extraction
|
15 |
def feature_extraction(img_path, model):
|
|
|
52 |
# Load ResNet model for image feature extraction
|
53 |
model = ResNet50(weights='imagenet', include_top=False, input_shape=(224, 224, 3))
|
54 |
model.trainable = False
|
55 |
+
model = tf.keras.Sequential([
|
56 |
model,
|
57 |
GlobalMaxPooling2D()
|
58 |
])
|