Kalbe-x-Bangkit commited on
Commit
2bc7b36
1 Parent(s): 9a58996

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -15
app.py CHANGED
@@ -123,21 +123,8 @@ if uploaded_file is not None:
123
 
124
  @st.cache_resource
125
  def load_gradcam_model():
126
- base_model = DenseNet121(weights="./densenet.hdf5",
127
- include_top=False)
128
- x = base_model.output
129
-
130
- # add a global spatial average pooling layer
131
- x = GlobalAveragePooling2D()(x)
132
-
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
 
123
 
124
  @st.cache_resource
125
  def load_gradcam_model():
126
+ model = keras.models.load_model('./model_renamed.h5', compile=False)
127
+ return model
 
 
 
 
 
 
 
 
 
 
 
 
 
128
 
129
 
130
  # Utility Functions