File size: 433 Bytes
c8ffefe | 1 2 3 4 5 6 7 8 9 10 11 | import torch
from your_model_file import AdvancedFusionModel # Make sure to have your model definition available
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model = (num_classes=45) # Example for NWPU-RESISC45, adjust as needed
model_path = "path/to/your/model_weights.pth" # e.g., 'uc_aid_nwpu_weights.pth'
model.load_state_dict(torch.load(model_path, map_location=device))
model.to(device)
model.eval() |