starpreeda commited on
Commit
f7889c7
·
verified ·
1 Parent(s): 94d435b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +20 -0
README.md CHANGED
@@ -54,3 +54,23 @@ Input (224, 224, 3)
54
  ↳ Dropout(0.4)
55
  ↳ Dense(4, activation='softmax')
56
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  ↳ Dropout(0.4)
55
  ↳ Dense(4, activation='softmax')
56
  ---
57
+ 🚀 How to Load and Use
58
+
59
+ import tensorflow as tf
60
+ from tensorflow.keras.applications import EfficientNetB0
61
+ from tensorflow.keras.layers import Dense, GlobalAveragePooling2D, Dropout, BatchNormalization
62
+ from tensorflow.keras.models import Model
63
+
64
+ # Reconstruct Model Architecture
65
+ base_model = EfficientNetB0(weights=None, include_top=False, input_shape=(224, 224, 3))
66
+ x = base_model.output
67
+ x = GlobalAveragePooling2D()(x)
68
+ x = BatchNormalization()(x)
69
+ x = Dense(256, activation='relu')(x)
70
+ x = Dropout(0.4)(x)
71
+ outputs = Dense(4, activation='softmax')(x)
72
+
73
+ model = Model(inputs=base_model.input, outputs=outputs)
74
+
75
+ # Load Weights
76
+ model.load_weights("efficientnetb0_finetuned_brain_mri.keras")