Commit
·
a8a09e4
1
Parent(s):
bd9bee9
Update README.md
Browse files
README.md
CHANGED
|
@@ -12,7 +12,7 @@ The model was trained using bands RGB (2, 3 and 4) (Red, Green and Blue) of the
|
|
| 12 |
The input shape of the model is 224, 224, 3. To extract features you should remove the last layer.
|
| 13 |
|
| 14 |
The model can be read as (example in jupyer):
|
| 15 |
-
|
| 16 |
!git lfs install
|
| 17 |
!git clone https://huggingface.co/MITCriticalData/Sentinel-2_ViT_Autoencoder_RGB_full_Colombia_Dataset
|
| 18 |
|
|
@@ -21,7 +21,19 @@ from transformers import TFViTModel
|
|
| 21 |
|
| 22 |
|
| 23 |
model = tf.keras.models.load_model('Sentinel-2_ViT_Autoencoder_RGB_full_Colombia_Dataset', custom_objects={"TFViTModel": TFViTModel})
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
## Intended uses & limitations
|
| 27 |
|
|
|
|
| 12 |
The input shape of the model is 224, 224, 3. To extract features you should remove the last layer.
|
| 13 |
|
| 14 |
The model can be read as (example in jupyer):
|
| 15 |
+
```
|
| 16 |
!git lfs install
|
| 17 |
!git clone https://huggingface.co/MITCriticalData/Sentinel-2_ViT_Autoencoder_RGB_full_Colombia_Dataset
|
| 18 |
|
|
|
|
| 21 |
|
| 22 |
|
| 23 |
model = tf.keras.models.load_model('Sentinel-2_ViT_Autoencoder_RGB_full_Colombia_Dataset', custom_objects={"TFViTModel": TFViTModel})
|
| 24 |
+
```
|
| 25 |
+
|
| 26 |
+
You can extract the embeddings removing the last layer using:
|
| 27 |
+
```
|
| 28 |
+
import tensorflow as tf
|
| 29 |
+
|
| 30 |
+
model = tf.keras.Sequential()
|
| 31 |
+
|
| 32 |
+
for layer in autoencoder.layers[:-1]: # just exclude last layer from copying
|
| 33 |
+
model.add(layer)
|
| 34 |
+
|
| 35 |
+
```
|
| 36 |
+
|
| 37 |
|
| 38 |
## Intended uses & limitations
|
| 39 |
|