Update README.md
Browse files
README.md
CHANGED
|
@@ -6,8 +6,8 @@ lon_mean = -75.19143495078883
|
|
| 6 |
|
| 7 |
lon_std = 0.0006184167829766685
|
| 8 |
|
|
|
|
| 9 |
# TO RUN:
|
| 10 |
-
|
| 11 |
from huggingface_hub import hf_hub_download
|
| 12 |
import torchvision.models as models
|
| 13 |
import torch
|
|
@@ -16,8 +16,8 @@ import torch.nn as nn
|
|
| 16 |
# Specify the repository and the filename of the model you want to load
|
| 17 |
repo_id = "cis-5190-final-fall24/ImageToGPSproject_model" # Replace with your repo name
|
| 18 |
filename = "final_model.pth"
|
| 19 |
-
|
| 20 |
class ResNetGPSModel(nn.Module):
|
|
|
|
| 21 |
def __init__(self):
|
| 22 |
super(ResNetGPSModel, self).__init__()
|
| 23 |
self.resnet = models.resnet101() # Updated for PyTorch >=0.13
|
|
@@ -36,4 +36,5 @@ model_path = hf_hub_download(repo_id=repo_id, filename=filename)
|
|
| 36 |
# Load the model using torch
|
| 37 |
state_dict = torch.load(model_path)
|
| 38 |
model.load_state_dict(state_dict)
|
| 39 |
-
model.eval() # Set the model to evaluation mode
|
|
|
|
|
|
| 6 |
|
| 7 |
lon_std = 0.0006184167829766685
|
| 8 |
|
| 9 |
+
```
|
| 10 |
# TO RUN:
|
|
|
|
| 11 |
from huggingface_hub import hf_hub_download
|
| 12 |
import torchvision.models as models
|
| 13 |
import torch
|
|
|
|
| 16 |
# Specify the repository and the filename of the model you want to load
|
| 17 |
repo_id = "cis-5190-final-fall24/ImageToGPSproject_model" # Replace with your repo name
|
| 18 |
filename = "final_model.pth"
|
|
|
|
| 19 |
class ResNetGPSModel(nn.Module):
|
| 20 |
+
|
| 21 |
def __init__(self):
|
| 22 |
super(ResNetGPSModel, self).__init__()
|
| 23 |
self.resnet = models.resnet101() # Updated for PyTorch >=0.13
|
|
|
|
| 36 |
# Load the model using torch
|
| 37 |
state_dict = torch.load(model_path)
|
| 38 |
model.load_state_dict(state_dict)
|
| 39 |
+
model.eval() # Set the model to evaluation mode
|
| 40 |
+
```
|