Download app.py from Jamtang/classification: direct link, hf CLI and curl.
- Browser
- Download file 433 Bytes
-
https://huggingface.co/Jamtang/classification/resolve/main/app.py
- Command line
-
hf download hf://Jamtang/classification/app.py
-
curl -L -o app.py https://huggingface.co/Jamtang/classification/resolve/main/app.py
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() |