classification / app.py
tangyuanhao
Create app.py
c8ffefe verified
Raw
History Blame Contribute Delete
433 Bytes
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()