Spaces:
Runtime error
Runtime error
Commit
·
f3e03bc
1
Parent(s):
4165a15
Update app.py
Browse files
app.py
CHANGED
|
@@ -64,14 +64,20 @@ def inference(input_img, is_gray, input_quality, zoom, x_shift, y_shift):
|
|
| 64 |
print(f'loading model from {model_path}')
|
| 65 |
|
| 66 |
model = net(in_nc=n_channels, out_nc=n_channels, nc=nc, nb=nb, act_mode='R')
|
|
|
|
| 67 |
model.load_state_dict(torch.load(model_path), strict=True)
|
|
|
|
| 68 |
model.eval()
|
|
|
|
| 69 |
for k, v in model.named_parameters():
|
| 70 |
v.requires_grad = False
|
|
|
|
| 71 |
model = model.to(device)
|
| 72 |
|
| 73 |
print("Model loaded.")
|
| 74 |
|
|
|
|
|
|
|
| 75 |
test_results = OrderedDict()
|
| 76 |
test_results['psnr'] = []
|
| 77 |
test_results['ssim'] = []
|
|
|
|
| 64 |
print(f'loading model from {model_path}')
|
| 65 |
|
| 66 |
model = net(in_nc=n_channels, out_nc=n_channels, nc=nc, nb=nb, act_mode='R')
|
| 67 |
+
print("#model.load_state_dict(torch.load(model_path), strict=True)")
|
| 68 |
model.load_state_dict(torch.load(model_path), strict=True)
|
| 69 |
+
print("#model.eval()")
|
| 70 |
model.eval()
|
| 71 |
+
print("#for k, v in model.named_parameters()")
|
| 72 |
for k, v in model.named_parameters():
|
| 73 |
v.requires_grad = False
|
| 74 |
+
print("#model.to(device)")
|
| 75 |
model = model.to(device)
|
| 76 |
|
| 77 |
print("Model loaded.")
|
| 78 |
|
| 79 |
+
print("Model loaded.")
|
| 80 |
+
|
| 81 |
test_results = OrderedDict()
|
| 82 |
test_results['psnr'] = []
|
| 83 |
test_results['ssim'] = []
|