Spaces:
Runtime error
Runtime error
Update codes.py
Browse files
codes.py
CHANGED
|
@@ -62,18 +62,6 @@ class Build_IRmodel_Resnet(nn.Module):
|
|
| 62 |
predction = {'Affine_mtrx': Prd_Affine_mtrx}
|
| 63 |
return predction
|
| 64 |
|
| 65 |
-
from torchvision.models import resnet18
|
| 66 |
-
|
| 67 |
-
core_model_tst = resnet18(pretrained=True)
|
| 68 |
-
core_model_tst.fc = Identity()
|
| 69 |
-
core_model_tst.load_state_dict(torch.load(file_savingfolder+'core_model'+ext+'.pth'))
|
| 70 |
-
core_model_tst.to(device)
|
| 71 |
-
IR_Model_tst = Build_IRmodel_Resnet(core_model_tst, registration_method)
|
| 72 |
-
IR_Model_tst.load_state_dict(torch.load(file_savingfolder+'IR_Model'+ext+'.pth'))
|
| 73 |
-
IR_Model_tst.to(device)
|
| 74 |
-
IR_Model_tst.eval()
|
| 75 |
-
|
| 76 |
-
|
| 77 |
def pil_to_numpy(im):
|
| 78 |
im.load()
|
| 79 |
# Unpack data
|
|
|
|
| 62 |
predction = {'Affine_mtrx': Prd_Affine_mtrx}
|
| 63 |
return predction
|
| 64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
def pil_to_numpy(im):
|
| 66 |
im.load()
|
| 67 |
# Unpack data
|