Update app.py
Browse files
app.py
CHANGED
@@ -133,11 +133,11 @@ def load_gradcam_model():
|
|
133 |
# and a logistic layer
|
134 |
predictions = Dense(14, activation="sigmoid")(x)
|
135 |
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
|
140 |
-
return
|
141 |
|
142 |
|
143 |
# Utility Functions
|
@@ -524,7 +524,7 @@ if uploaded_file is not None:
|
|
524 |
with col2:
|
525 |
# file_bytes = np.asarray(bytearray(uploaded_file.read()), dtype=np.uint8)
|
526 |
# image = cv2.imdecode(file_bytes, 1)
|
527 |
-
if st.button('Auto Detect'):
|
528 |
# st.write("Processing...")
|
529 |
# input_image = preprocess_image(image)
|
530 |
# pred_bbox, pred_label, pred_label_confidence = predict(model_detection, input_image)
|
|
|
133 |
# and a logistic layer
|
134 |
predictions = Dense(14, activation="sigmoid")(x)
|
135 |
|
136 |
+
model_gradcam = Model(inputs=base_model.input, outputs=predictions)
|
137 |
+
model_gradcam.compile(optimizer='adam', loss="categorical_crossentropy")
|
138 |
+
model_gradcam.load_weights("./model_renamed.h5")
|
139 |
|
140 |
+
return model_gradcam
|
141 |
|
142 |
|
143 |
# Utility Functions
|
|
|
524 |
with col2:
|
525 |
# file_bytes = np.asarray(bytearray(uploaded_file.read()), dtype=np.uint8)
|
526 |
# image = cv2.imdecode(file_bytes, 1)
|
527 |
+
# if st.button('Auto Detect'):
|
528 |
# st.write("Processing...")
|
529 |
# input_image = preprocess_image(image)
|
530 |
# pred_bbox, pred_label, pred_label_confidence = predict(model_detection, input_image)
|