tangyuanhao commited on
Commit
c8ffefe
·
verified ·
1 Parent(s): d78f40e

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from your_model_file import AdvancedFusionModel # Make sure to have your model definition available
3
+
4
+ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
5
+
6
+ model = (num_classes=45) # Example for NWPU-RESISC45, adjust as needed
7
+
8
+ model_path = "path/to/your/model_weights.pth" # e.g., 'uc_aid_nwpu_weights.pth'
9
+ model.load_state_dict(torch.load(model_path, map_location=device))
10
+ model.to(device)
11
+ model.eval()