ff98 commited on
Commit
b79c29e
·
1 Parent(s): b8e56b8

model load changed

Browse files
Files changed (1) hide show
  1. app.py +13 -4
app.py CHANGED
@@ -25,10 +25,19 @@ st.markdown(
25
  )
26
 
27
 
28
-
29
- eff_net_model = tf.keras.models.load_model('EfficientNet_Models/efficientnetb3_binary_classifier_8.h5')
30
- eff_net_art_model = tf.keras.models.load_model('EfficientNet_Models/EfficientNet_fine_tune_art_model.h5')
31
- cnn_model = 'CNN_model_weight/model_weights.weights.h5'
 
 
 
 
 
 
 
 
 
32
 
33
  # CNN model
34
 
 
25
  )
26
 
27
 
28
+ def load_models():
29
+ # Load all models at once
30
+ eff_net_model = tf.keras.models.load_model('EfficientNet_Models/efficientnetb3_binary_classifier_8.h5')
31
+ eff_net_art_model = tf.keras.models.load_model('EfficientNet_Models/EfficientNet_fine_tune_art_model.h5')
32
+ cnn_model = 'CNN_model_weight/model_weights.weights.h5'
33
+ return eff_net_model, eff_net_art_model, cnn_model
34
+
35
+ # Access cached models
36
+ eff_net_model, eff_net_art_model, cnn_model = load_models()
37
+
38
+ # eff_net_model = tf.keras.models.load_model('EfficientNet_Models/efficientnetb3_binary_classifier_8.h5')
39
+ # eff_net_art_model = tf.keras.models.load_model('EfficientNet_Models/EfficientNet_fine_tune_art_model.h5')
40
+ # cnn_model = 'CNN_model_weight/model_weights.weights.h5'
41
 
42
  # CNN model
43