Changed modelWeights
Browse files
app.py
CHANGED
|
@@ -35,7 +35,7 @@ print(f"took {(time.time() - start_time) / 60} minutes to load face_recognition"
|
|
| 35 |
# return gr.Image(outputs[0])
|
| 36 |
|
| 37 |
model_repo_id = "CSSE416-final-project/faceRecogModel"
|
| 38 |
-
weight_file_id = "
|
| 39 |
|
| 40 |
|
| 41 |
# 1. Load the model from Hugging Face Hub
|
|
@@ -44,7 +44,7 @@ def load_model(repo_id):
|
|
| 44 |
weights_path = hf_hub_download(repo_id=model_repo_id, filename=weight_file_id)
|
| 45 |
|
| 46 |
# Initialize the ResNet-18 architecture
|
| 47 |
-
model = torchvision.models.resnet18(pretrained=
|
| 48 |
num_ftrs = model.fc.in_features
|
| 49 |
model.fc = nn.Linear(num_ftrs, 100) # Adjust for your task (e.g., 128 classes)
|
| 50 |
# TODO: check if this number^^ corresponds to the number of classes
|
|
|
|
| 35 |
# return gr.Image(outputs[0])
|
| 36 |
|
| 37 |
model_repo_id = "CSSE416-final-project/faceRecogModel"
|
| 38 |
+
weight_file_id = "modelWeights101.bin"
|
| 39 |
|
| 40 |
|
| 41 |
# 1. Load the model from Hugging Face Hub
|
|
|
|
| 44 |
weights_path = hf_hub_download(repo_id=model_repo_id, filename=weight_file_id)
|
| 45 |
|
| 46 |
# Initialize the ResNet-18 architecture
|
| 47 |
+
model = torchvision.models.resnet18(pretrained=False)
|
| 48 |
num_ftrs = model.fc.in_features
|
| 49 |
model.fc = nn.Linear(num_ftrs, 100) # Adjust for your task (e.g., 128 classes)
|
| 50 |
# TODO: check if this number^^ corresponds to the number of classes
|