jonathan-roberts1/NWPU-RESISC45
Viewer • Updated • 31.5k • 283 • 4
How to use Arshul26/Efficientnet-B0 with Adapters:
from adapters import AutoAdapterModel
model = AutoAdapterModel.from_pretrained("undefined")
model.load_adapter("Arshul26/Efficientnet-B0", set_active=True)This model uses EfficientNet-B0 for classifying 45 land-use categories from the NWPU-RESISC45 dataset. Transfer learning and fine-tuning techniques were applied.
Note: Dataset not included in repo; download link below. NWPU-RESISC45 Dataset: https://github.com/remote-sensing-datasets/NWPU-RESISC45
from tensorflow.keras.models import load_model
from tensorflow.keras.preprocessing import image
import numpy as np
model = load_model("model_weights.h5")
img = image.load_img("example.jpg", target_size=(224,224))
x = image.img_to_array(img)
x = np.expand_dims(x, axis=0)/255.0
pred = model.predict(x)
pred_class = np.argmax(pred, axis=1)
print(f"Predicted class: {pred_class}")
Base model
google/efficientnet-b0