Spaces:
Running
Running
Update main_test_CMFNet.py
Browse files- main_test_CMFNet.py +2 -1
main_test_CMFNet.py
CHANGED
@@ -53,10 +53,11 @@ def main():
|
|
53 |
padh = H - h if h % mul != 0 else 0
|
54 |
padw = W - w if w % mul != 0 else 0
|
55 |
input_ = F.pad(input_, (0, padw, 0, padh), 'reflect')
|
|
|
56 |
with torch.no_grad():
|
57 |
restored = model(input_)
|
58 |
|
59 |
-
restored = torch.clamp(restored
|
60 |
restored = restored[:, :, :h, :w]
|
61 |
restored = restored.permute(0, 2, 3, 1).cpu().detach().numpy()
|
62 |
restored = img_as_ubyte(restored[0])
|
|
|
53 |
padh = H - h if h % mul != 0 else 0
|
54 |
padw = W - w if w % mul != 0 else 0
|
55 |
input_ = F.pad(input_, (0, padw, 0, padh), 'reflect')
|
56 |
+
|
57 |
with torch.no_grad():
|
58 |
restored = model(input_)
|
59 |
|
60 |
+
restored = torch.clamp(restored, 0, 1)
|
61 |
restored = restored[:, :, :h, :w]
|
62 |
restored = restored.permute(0, 2, 3, 1).cpu().detach().numpy()
|
63 |
restored = img_as_ubyte(restored[0])
|