Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -12,7 +12,7 @@ CLASSES = ["positive", "planktonic", "clumped", "rods", "filaments"]
|
|
| 12 |
_weights = hf_hub_download("aaristov/bacterial-morphology-resnet34", "bacteria_trained_model_resnet34")
|
| 13 |
model = torchvision.models.resnet34()
|
| 14 |
model.fc = torch.nn.Linear(512, len(CLASSES))
|
| 15 |
-
model.load_state_dict(torch.load(_weights, map_location="cpu"))
|
| 16 |
model.eval()
|
| 17 |
|
| 18 |
tfm = transforms.Compose([
|
|
|
|
| 12 |
_weights = hf_hub_download("aaristov/bacterial-morphology-resnet34", "bacteria_trained_model_resnet34")
|
| 13 |
model = torchvision.models.resnet34()
|
| 14 |
model.fc = torch.nn.Linear(512, len(CLASSES))
|
| 15 |
+
model.load_state_dict(torch.load(_weights, map_location="cpu", weights_only=True))
|
| 16 |
model.eval()
|
| 17 |
|
| 18 |
tfm = transforms.Compose([
|