Spaces:
Build error
Build error
Download model.py from devfire/ScanSmartAI: direct link, hf CLI and curl.
- Browser
- Download file 709 Bytes
-
https://huggingface.co/spaces/devfire/ScanSmartAI/resolve/68296f4b909e8910fa7e8d5307226e526ba83b2a/model.py
- Command line
-
hf download hf://spaces/devfire/ScanSmartAI@68296f4b909e8910fa7e8d5307226e526ba83b2a/model.py
-
curl -L -o model.py https://huggingface.co/spaces/devfire/ScanSmartAI/resolve/68296f4b909e8910fa7e8d5307226e526ba83b2a/model.py
709 Bytes
| import tensorflow as tf | |
| from tensorflow.keras import layers, models | |
| from tensorflow.keras.applications import InceptionV3 | |
| def create_model(): | |
| base_model = InceptionV3(weights='imagenet', include_top=False, input_shape=(150, 150, 3)) | |
| base_model.trainable = False # Freezing the base model layers | |
| model = models.Sequential([ | |
| base_model, | |
| layers.GlobalAveragePooling2D(), | |
| layers.Dense(512, activation='relu'), | |
| layers.Dropout(0.5), | |
| layers.Dense(1, activation='sigmoid') | |
| ]) | |
| model.compile(optimizer=tf.keras.optimizers.Adam(learning_rate=0.0001), | |
| loss='binary_crossentropy', | |
| metrics=['accuracy']) | |
| return model | |